CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

event order was different

by mjq » 19 Sep 2014 03:56

Hello,

My App has Grid and Navigator, and editing area using Edit.

Because I wanted to cancel editing/inserting data
if current row changed before posting,
I assinged SelectRow event handler for the grid like this:

delphi code
procedure TMyFrame.IWCGJQGrid1JQGridOptionsSelectRow(Sender: TObject;
AParams: TStringList);
begin
if Query1.State <> dsBrowse then Query1.Cancel;
IWCGJQGrid1.LocateSelectedRowId;
end;


When editing, this works well (in fact there are some problems but I don't mention now),
but when the row of the grid was changed by grid's paging button after inserting and before posting,
error message dialog was showed, so it seemed that Query1.Cancel was not executed.

I investigated, and found that the order of occurring event was different in some situation.
When the Query inserting,
if the grid's row was changed by clicking another row, SelectRow event occurs before Post event of Query,
but if changed by paging button, the occurrence order was reverse.

BTW, the paging button which I said is this:
pagingbutton.gif


I wonder why these are different.
Anyway, aren't there any other good means to resolve?
You do not have the required permissions to view the files attached to this post.
mjq
 
Posts: 58
Joined: 20 Aug 2014 02:46

by Jorge Sousa » 19 Sep 2014 10:26

Hello

You have to submit us a test case, because we don't know what you're doing.

If you want you can use the attached demo, because of the data.
You do not have the required permissions to view the files attached to this post.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by mjq » 22 Sep 2014 07:47

Hi,

Now I submitted test case.

It's difficult for me to use attached demo and apply my problems,
so I simplified and provided my app which contains some problems which I want to resolve.

I hope that this becomes the key to some kind of solution...

P.S.
In order to function the foreign key constraint, you might need to use latest version of SQLite.
And to enable paging button, you might need to resize browser that you execute this test case.
You do not have the required permissions to view the files attached to this post.
mjq
 
Posts: 58
Joined: 20 Aug 2014 02:46

by mjq » 22 Sep 2014 07:50

Hi again,

The explanation is:

*couldn't cancel inserting data programatically when grid's paging button was clicked before posting.
To confirm, please click grid's paging button after clicking insert button of navigator.
(Please try several times because this phenomenon sometimes occurs and sometimes does not occur.
It's more likely to occur when you click the "first" button or the "last" button.)
mjq
 
Posts: 58
Joined: 20 Aug 2014 02:46


Return to JQGrid

cron

Who is online

Users browsing this forum: No registered users and 0 guests

Contact Us.