Jump to content

Add recordcount in pagingBar on UniDBGrid


skafy

Recommended Posts

3 hours ago, skafy said:

I would like to add text to pagingBar that will show total number of records that in DBGrid (dataset). How can this be achived.

Hello,

Maybe you wanted like this:

UniDBGrid.ClientEvents.UniEvents ->

function pagingBar.beforeInit(sender, config)
{
    config.displayInfo=true;
}

 

  • Thanks 1
  • Upvote 1
Link to comment
Share on other sites

  • 3 years later...
On 5/27/2020 at 3:23 PM, Sherzod said:

Hello,

Maybe you wanted like this:

UniDBGrid.ClientEvents.UniEvents ->

function pagingBar.beforeInit(sender, config)
{
    config.displayInfo=true;
}

 

With TUniDBGrid(Components[CI]) do
                      Begin
                         if Columns.Count>1 then
                            OnAfterLoad:=UniDBGridAfterLoad;
                         JSInterface.JSCall('addCls', ['Grid1css']);
                         ClientEvents.UniEvents.Values['beforeInit']:=     'function beforeInit(sender, config)config.displayInfo=true;}';

                    End

 

It Says "Unexpected identifier 'config'"

Where is my mistake?

image.png.47cfdf58ba4f60d7eaf027e797671cd8.png

Link to comment
Share on other sites

10 hours ago, Sherzod said:

Hello, 

Yes, because you didn't copy correctly. Please be careful. Missing { character before config.

Thank you
No more errors
But he didn't do anything!
 

image.png.0c0605dbeb982d9c1cc72c3e3c8ea6cb.png
In fact, I need to know how many records I have out of all the records in the dataset (RecNo/RecordCount)
And I don't know how to get it

Is it possible to modify the code?

Link to comment
Share on other sites

20 hours ago, Sherzod said:

ClientEvents.UniEvents.Values['pagingBar.beforeInit']:=

thank you
Your solution worked
one more question
When I activate the row number, it starts from 1 on each page
Is there a way to make it persistent instead of resetting every time?

Link to comment
Share on other sites

  • 8 months later...
On 5/27/2020 at 6:53 PM, Sherzod said:

Hello,

Maybe you wanted like this:

UniDBGrid.ClientEvents.UniEvents ->

function pagingBar.beforeInit(sender, config)
{
    config.displayInfo=true;
}

 

Hello,

It would be nice if this hack could be made as a property of TUniDBGrid. Something like UniDBGrid -> Options -> dgShowRecordCount

Thanks

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...