Jump to content

Recommended Posts

Posted

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 ?

  • 1 month later...
  • 2 months later...
  • 4 weeks later...
Posted
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 3
Posted

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]
            })
        })]
    });
  }
}

 

Posted
Quote

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

Source code in the ServerModule.
 

Quote

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

;)

  • 4 weeks later...
Posted
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;

 

Posted
5 minutes ago, multimesut said:

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

Hi,

On 1/28/2019 at 9:23 PM, Marlon Nardi said:

PageSizeExtension.rar

Can you try to use this instead?

Posted
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;

 

Posted
3 hours ago, multimesut said:

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

OK, I will check

Posted
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;

 

Posted

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
  • 3 months later...
Posted
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

Posted
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? 

Posted
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? 

Posted
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]
    });
}

 

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

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