Jump to content

PageSize Extension for UniDBGrid


Recommended Posts

An other problem :

if you use the combo box for changing pagesize it seems that it is changed only on client side. If you change datasource on server(on applying filter for exemple), it used the value that is in weboptions.pagesize and not the value that is in combo.

 

How can we change value on serverside when we change on client side ?

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 4 weeks later...
On 1/3/2019 at 9:37 AM, Tokay said:

I also need a help with this topic. I need a working example of PageSize Extension for UniDBGrid for latest UniGUI, thank you!

 

On 10/3/2018 at 3:02 PM, thiagopedro said:

Does anyone have a working example in ext-6.5.3?

 

On 8/7/2018 at 2:30 PM, delagoutte said:

An other problem :

if you use the combo box for changing pagesize it seems that it is changed only on client side. If you change datasource on server(on applying filter for exemple), it used the value that is in weboptions.pagesize and not the value that is in combo.

 

How can we change value on serverside when we change on client side ?

Example the latest version uniGui.
Serverside its worked.

https://github.com/marlonnardi/extjs-ux-paging-toolbar-resizer/blob/master/ux/PagingToolbarResizer.js
 

function beforerender(sender, eOpts)
{
  if (sender.pagingBar) {
    sender.removeDocked(sender.pagingBar, true);
    sender.addDocked({
        dock: 'bottom',
        items: [Ext.create('Ext.PagingToolbar', {
            pageSize: sender.store.pageSize,
            store: sender.store,
            displayInfo: true,
            displayMsg: 'Visualizando {0} - {1} de <b>{2}</b>',
            emptyMsg: "Não há registros",
            plugins: Ext.create('Ext.ux.PagingToolbarResizer', {
                displayText: 'Registros por página',
                options: [25, 50, 100, 150, 200]
            })
        })]
    });
  }
}

Visit my Store :D https://store.falconsistemas.com.br 

extjs6_0.PNG

extjs6_1.PNG

PageSizeExtension.rar

  • Like 2
Link to comment
Share on other sites

1. Do we need the PagingToolbarResizer.js? If I understand correctly, your sample works fine without this file.

2. For all: code posted by Marlon Nardi shall be added to the beforerender event of the grid:

function beforerender(sender, eOpts)
{
  if (sender.pagingBar) {
    sender.removeDocked(sender.pagingBar, true);
    sender.addDocked({
        dock: 'bottom',
        items: [Ext.create('Ext.PagingToolbar', {
            pageSize: sender.store.pageSize,
            store: sender.store,
            displayInfo: true,
            displayMsg: 'Visualizando {0} - {1} de <b>{2}</b>',
            emptyMsg: "Não há registros",
            plugins: Ext.create('Ext.ux.PagingToolbarResizer', {
                displayText: 'Registros por página',
                options: [25, 50, 100, 150, 200]
            })
        })]
    });
  }
}

 

Link to comment
Share on other sites

  • 4 weeks later...
On 6/20/2017 at 8:27 AM, Sherzod said:

Hi @Sherzod , the following code does not work in extjs6. what can I do? Thank you

 

Procedure TMSTUniDBGrid.Loaded;
begin
  inherited;
  JSAddListener('store.beforeload',
      JSFunction('store, operation, eOpts',  'if (operation.params) {operation.params.limit = operation.limit;}')
   );
end;

 

Link to comment
Share on other sites

47 minutes ago, Sherzod said:

Hi,

Can you try to use this instead?

Yes, same problem. PageSize is failing for Reflesh. does not work in solution. (operation.params.limit)

 

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
CDS.Active:=false;
end;

procedure TMainForm.UniButton2Click(Sender: TObject);
begin
CDS.Active:=true;
end;

 

Link to comment
Share on other sites

2 hours ago, multimesut said:

hello @Sherzod, did you test?

Hello,

As a workaround, can you try this approach?:

procedure TMainForm.UniButton2Click(Sender: TObject);
begin
  CDS.Active := True;
  dbg1.JSInterface.JSCode('Ext.defer(function(){'#1'.getStore().load()}, 20);'); //<---
end;

 

Link to comment
Share on other sites

yes, it works. thanks. but it will be a manual method. not detecting limit value. Can't do it automatically in the old version. I was using the code below.

 

  JSAddListener('store.beforeload',
      JSFunction('store, operation, eOpts',  'if (operation.params) {operation.params.limit = operation.limit;}')
   );

 

  • Like 1
Link to comment
Share on other sites

  • 3 months later...
On 1/28/2019 at 2:23 PM, Marlon Nardi said:

 

 

Example the latest version uniGui.
Serverside its worked.

https://github.com/marlonnardi/extjs-ux-paging-toolbar-resizer/blob/master/ux/PagingToolbarResizer.js
 


function beforerender(sender, eOpts)
{
  if (sender.pagingBar) {
    sender.removeDocked(sender.pagingBar, true);
    sender.addDocked({
        dock: 'bottom',
        items: [Ext.create('Ext.PagingToolbar', {
            pageSize: sender.store.pageSize,
            store: sender.store,
            displayInfo: true,
            displayMsg: 'Visualizando {0} - {1} de <b>{2}</b>',
            emptyMsg: "Não há registros",
            plugins: Ext.create('Ext.ux.PagingToolbarResizer', {
                displayText: 'Registros por página',
                options: [25, 50, 100, 150, 200]
            })
        })]
    });
  }
}

Visit my Store :D https://store.falconsistemas.com.br 

extjs6_0.PNG

extjs6_1.PNG

PageSizeExtension.rar

I used this option from Marlon but it's giving this problem.

Grid.gif

Link to comment
Share on other sites

13 hours ago, eduardosuruagy said:

I used this option from Marlon but it's giving this problem.

Hello, 

Which build are you using? 

Have you tried with the latest build? 

Link to comment
Share on other sites

21 minutes ago, eduardosuruagy said:

I'm using the most recent and the theme is Gray

Sorry, can you make a simple testcase for reproduce? 

Link to comment
Share on other sites

15 hours ago, eduardosuruagy said:

Follow the test!!

Hi,

Thanks for the test case.

Try to use this approach.

1. Remove: function beforerender

2. Add: dbgrid_cadastro2 -> ClientEvents -> UniEvents -> function pagingBar.beforeInit(sender, config): 

function pagingBar.beforeInit(sender, config)
{
    config.displayInfo = true,
    config.displayMsg  = 'Visualizando {0} - {1} de <b>{2}</b>',
    config.emptyMsg    = "Não há registros",
    config.plugins     = Ext.create('Ext.ux.PagingToolbarResizer', {
        displayText: 'Registros por página',
            options: [25, 50, 100, 150, 200]
    });
}

 

Link to comment
Share on other sites

8 hours ago, Sherzod said:

Hi,

Thanks for the test case.

Try to use this approach.

1. Remove: function beforerender

2. Add: dbgrid_cadastro2 -> ClientEvents -> UniEvents -> function pagingBar.beforeInit(sender, config): 


function pagingBar.beforeInit(sender, config)
{
    config.displayInfo = true,
    config.displayMsg  = 'Visualizando {0} - {1} de <b>{2}</b>',
    config.emptyMsg    = "Não há registros",
    config.plugins     = Ext.create('Ext.ux.PagingToolbarResizer', {
        displayText: 'Registros por página',
            options: [25, 50, 100, 150, 200]
    });
}

 

It works perfectly thank you very much for the answer, now why the filter does not follow the size of the column anymore? In the previous version I did not have this problem.

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