Jump to content


Photo

client events run time


  • Please log in to reply
23 replies to this topic

#1 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 804 posts

Posted 16 April 2018 - 03:17 PM

H,

 

I do this for dbgrids in run time:

 

   tunidbgrid(xdbg).ClientEvents.unievents.Values['beforeinit']:='function beforeinit(sender, config)' +
             '{config.viewConfig.enableTextSelection = true;}';
 

This don't work.

 

How can I do it in run time?

 

Thanks.

 


  • 0

#2 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 804 posts

Posted 16 April 2018 - 04:02 PM

I need this for all the grids un the app.

 

Can do this in CSS? in mainform script?

 

Thanks in advance.


  • 0

#3 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4558 posts

Posted 16 April 2018 - 04:59 PM

Hi,

 

H,

 

I do this for dbgrids in run time:

 

   tunidbgrid(xdbg).ClientEvents.unievents.Values['beforeinit']:='function beforeinit(sender, config)' +
             '{config.viewConfig.enableTextSelection = true;}';
 

This don't work.

 

Where do you use this code?


  • 0

#4 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 804 posts

Posted 16 April 2018 - 05:03 PM

in the onshow of the form that contains tje grid

Enviado desde mi SM-A500FU mediante Tapatalk
  • 0

#5 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 804 posts

Posted 16 April 2018 - 05:04 PM

I am trying not write this in evwry client event of every dbgrid.


Enviado desde mi SM-A500FU mediante Tapatalk
  • 0

#6 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4558 posts

Posted 16 April 2018 - 05:07 PM

in the onshow of the form that contains tje grid

Enviado desde mi SM-A500FU mediante Tapatalk

 

it should work


  • 0

#7 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4558 posts

Posted 16 April 2018 - 05:10 PM

Or, try this:

 

MainForm -> Script:

Ext.override(Ext.grid.View, { enableTextSelection: true });

  • 0

#8 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 804 posts

Posted 16 April 2018 - 05:19 PM

Great!!

 

Thanks.

 

In mainfor is better.

 

And this?:

 

function containercontextmenu(sender, e, eOpts)
{
  ajaxRequest(this, 'cellcontextmenu', ['ex='+e.getXY()[0], 'ey='+e.getXY()[1]]);
}

 

ths is also for every grid (extevents).

 

Thanks.


  • 0

#9 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4558 posts

Posted 16 April 2018 - 05:24 PM

UniDBGrid -> OnCellContextClick event ??


  • 0

#10 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 804 posts

Posted 16 April 2018 - 05:44 PM

yes

Enviado desde mi SM-A500FU mediante Tapatalk
  • 0

#11 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 804 posts

Posted 16 April 2018 - 08:26 PM

UniDBGrid -> OnCellContextClick event ??

but this don't work if grid is empty.

this is the reason of my prior post.

is possible to add in mainform script to not repeat in every dbgrid?



Enviado desde mi SM-A500FU mediante Tapatalk
  • 0

#12 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4558 posts

Posted 17 April 2018 - 04:12 AM

but this don't work if grid is empty.

 

Correct, because this applies to cells

 

 

is possible to add in mainform script to not repeat in every dbgrid?

 

Yes, it is possible, but I think, it is better to do this in the "code", for example, in the FormCreate event


  • 0

#13 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 804 posts

Posted 17 April 2018 - 08:12 AM

Sorry. Don't work.

 

But I think it could be better in mainform script, because I do only once, not in every form and/or every dbgrid.

 

How can I do it?

 

Thanks.


  • 0

#14 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4558 posts

Posted 17 April 2018 - 09:47 AM

Sorry. Don't work.

 

What does not work?


  • 0

#15 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 804 posts

Posted 17 April 2018 - 10:14 AM

add the code on form create has no effect in the grid

Enviado desde mi SM-A500FU mediante Tapatalk
  • 0

#16 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 804 posts

Posted 17 April 2018 - 10:29 AM

as I can see, in general, add the code in run time to grids, don't work.

 

for this, I think is better to add in mainform script (as you told me with enableTextSelection).


  • 0

#17 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4558 posts

Posted 17 April 2018 - 11:58 AM

as I can see, in general, add the code in run time to grids, don't work.

 

Sorry, provide the code, I will analyze


  • 0

#18 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 804 posts

Posted 17 April 2018 - 12:28 PM

This is the code, in every dbgrid:

 

function containercontextmenu(sender, e, eOpts)
{
  ajaxRequest(this, 'cellcontextmenu', ['ex='+e.getXY()[0], 'ey='+e.getXY()[1]]);
}

 

 

And for not repeat in every one, I'm trying to do this:

 

   tunidbgrid(xdbg).ClientEvents.ExtEvents.Values['containercontextmenu']:='function containercontextmenu(sender, e, eOpts)' +
             '{ajaxRequest(this, cellcontextmenu, [ex=+e.getXY()[0], ey=+e.getXY()[1]]);}';
 

 

As you told me with cellcontextmenu, I'd like to do this in mainform script, and do only once, not in every dbgrid individually.

 

Thanks.


  • 0

#19 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4558 posts

Posted 17 April 2018 - 01:02 PM

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
    UniDBGrid1.ClientEvents.ExtEvents.Values['containercontextmenu']:='function containercontextmenu(sender, e, eOpts)' +
    '{ajaxRequest(this, "_cellcontextmenu", ["ex="+e.getXY()[0], "ey="+e.getXY()[1]]);}';
end;

  • 0

#20 jahlxx

jahlxx

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 804 posts

Posted 17 April 2018 - 02:43 PM

Sorry, but don't work.

 

It does nothing if dbgrid is empty.


  • 0




1 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


    Bing (1)