Jump to content

Dbgrid selection doesn't work


eduardosuruagy

Recommended Posts

I am using dbgrid selection and when I use I add this event to it the selection stops working.

   UniDBGrid1.ClientEvents.ExtEvents.Add (
   'headerclick = function headerclick (ct, column, e, t, eOpts)' # 13 # 10 '{' # 13 # 10 '' +
   '' + Self.Name + '.' + UniDBGrid1.DataSource.DataSet.Name + '. GetStore (). Sort (column.dataIndex);' # 13 + # 10 '}');

Follows the fonts and a gif.

Demo.gif

UniGui - DBGridMemo.rar

Link to comment
Share on other sites

3 hours ago, eduardosuruagy said:

 UniDBGrid1.ClientEvents.ExtEvents.Add (
   'headerclick = function headerclick (ct, column, e, t, eOpts)' # 13 # 10 '{' # 13 # 10 '' +
   '' + Self.Name + '.' + UniDBGrid1.DataSource.DataSet.Name + '. GetStore (). Sort (column.dataIndex);' # 13 + # 10 '}');

What do you expect from this code?

Link to comment
Share on other sites

Your code gives the following errors:

Uncaught TypeError: Cannot read property 'getStore' of undefined
    at ctor.OnHeaderclick ((index):37)
    at ctor.fire (ext-all.js:20)
    at ctor.doFireEvent (ext-all.js:20)
    at ctor.doFireEvent (ext-all.js:20)
    at ctor.b.doFireEvent (ext-all.js:20)
    at ctor.fireEventArgs (ext-all.js:20)
    at ctor.<anonymous> (ext-all.js:20)
    at ctor.fire (ext-all.js:20)
    at ctor.doFireEvent (ext-all.js:20)
    at ctor.doFireEvent (ext-all.js:20)

 

Link to comment
Share on other sites

10 hours ago, eduardosuruagy said:

in which code?

 

15 hours ago, eduardosuruagy said:

UniDBGrid1.ClientEvents.ExtEvents.Add (
   'headerclick = function headerclick (ct, column, e, t, eOpts)' # 13 # 10 '{' # 13 # 10 '' +
   '' + Self.Name + '.' + UniDBGrid1.DataSource.DataSet.Name + '. GetStore (). Sort (column.dataIndex);' # 13 + # 10 '}');

 

Link to comment
Share on other sites

18 hours ago, Sherzod said:

Abra o console do navegador.

Even though I put this code below when I click the column to select all records the grid enters the procedure and orders the first column.

procedure TMainForm.UniDBGrid1TitleClick (Column: TUniDBGridColumn);
begin
         ClientDataSet1.IndexFieldNames: = Column.FieldName;
end;

Link to comment
Share on other sites

  • 2 weeks later...
18 minutes ago, eduardosuruagy said:

any news?

In your case, just try without this:

//  UniDBGrid1.ClientEvents.ExtEvents.Add(
//  'headerclick=function headerclick(ct, column, e, t, eOpts)'#13#10'{'#13#10'  ' +
//  ''+Self.Name+'.'+UniDBGrid1.DataSource.DataSet.Name+'.getStore().sort(column.dataIndex);'#13 + #10'}');

 

Link to comment
Share on other sites

2 hours ago, Sherzod said:

Desculpe, então explique mais uma vez, por favor, o que você deseja alcançar, sem levar em conta o código que você usa acima.

Just look at the video at the beginning of this topic, I need to click on the option to mark all records, which is not working. When I put any function to sort the grid this option to mark all the records stops working since I can't remove the sorting grid option, except you have another option that works along with the selection of the records.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...