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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...