Jump to content

UnidbGrid Editing and paged


UniUser

Recommended Posts

Hello, i have commercial version of Unigui (1.0.0.1394).

 

I have a unidbgrid where i can only modify a quantity field (clickstoedit=1, RowEditor=False)

All works ok but sometimes when i modify the quantity cell on the grid and i change page (without posting the value with enter), the value is not saved in the clientdataset.

If for example i click a button all works ok and the value is saved.

 

How can i force post when change page?

 

Thank for your answer.

 

 

Link to comment
Share on other sites

Hi,

 

Can you try this approach for now ?!:

 

1. UniDBGrid -> ClientEvents -> ExtEvents -> Ext.toolbar.Paging [pagingBar] -> function pagingBar.beforechange:

function pagingBar.beforechange(sender, page, eOpts)
{
    ajaxRequest(sender, '_post', []);
}

2. UniDBGrid -> OnAjaxEvent:

procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = '_post' then
    if (UniDBGrid1.DataSource.DataSet.State in [dsEdit]) then
      UniDBGrid1.DataSource.DataSet.Post;
end;

Best regards,

Link to comment
Share on other sites

Hi,

 

Can you try this approach for now ?!:

 

1. UniDBGrid -> ClientEvents -> ExtEvents -> Ext.toolbar.Paging [pagingBar] -> function pagingBar.beforechange:

function pagingBar.beforechange(sender, page, eOpts)
{
    ajaxRequest(sender, '_post', []);
}

2. UniDBGrid -> OnAjaxEvent:

procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = '_post' then
    if (UniDBGrid1.DataSource.DataSet.State in [dsEdit]) then
      UniDBGrid1.DataSource.DataSet.Post;
end;

Best regards,

 

Hello, it seems to work good.

Thank you for your support.

Best regards,

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