CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Changing other columns after edit

by Jorge Sousa » 18 Apr 2017 10:06

we don't understand what you mean, what you need, too vague.

Send a test case please
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by fateh78 » 18 Apr 2017 11:03

what i wrote is really understood and clear

any way forget everything before and start from beginning :

i claim that JQGrid is very usable and power component but not suitable to do the following :
" change column value depending on another column value change while it is in inline editing mode "

if you think otherwise you have to send us a demo showing how JQGrid can do this
this is very important in real BD App
also i stated that i have cold and stomach pain in addition to these problems

The ball is in your court

best regards Mr. Sousa
fateh78
 
Posts: 85
Joined: 16 Mar 2017 21:45

by Jorge Sousa » 18 Apr 2017 12:19

At design/create time

set JQGridOptions.OnAfterSaveCell.SendAllArguments:= True

Grab the JQGridOptions.OnAfterSaveCell.OnEvent, when the process gets to this event, the value is already saved into the grid's provider, whether is CellsProvider or DataSetProvider

procedure TCGJQJQueryGridDB.AfterSaveCell(Sender: TObject; AParams: TStringList);
begin
if AParams.Values['iRow'] = IntToStr(SomeColumn.Index) then
begin
IWCGJQGrid.JQGridOptions.SetCell(AParams.Values['rowid'],AnyOtherColumn.Index, SomeData);
end;
end;
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by fateh78 » 18 Apr 2017 13:59

very good,
this seems promising but still have these issues :

1- as i said before if you changing more than 1 cell value only first cell changes, like :
procedure TCGJQJQueryGridDB.AfterSaveCell(Sender: TObject; AParams: TStringList);
begin
if AParams.Values['iCol'] = IntToStr(Column_0.Index) then begin
IWCGJQGrid.JQGridOptions.SetCell(AParams.Values['rowid'], Column_1.Index, SomeData);
IWCGJQGrid.JQGridOptions.SetCell(AParams.Values['rowid'], Column_2.Index, SomeData);
IWCGJQGrid.JQGridOptions.SetCell(AParams.Values['rowid'], Column_3.Index, SomeData);
end;
end;

only Column_1 cell changes !!, does i missed something ???
======================================

2- second issue is difficult to explain but i'll try :
if Column_1 is adjacent to Column_0 ==> enter value to Column_0 then pressed enter ==> you will see a strange behavior (i can not describe)

any way very good advance in the way
fateh78
 
Posts: 85
Joined: 16 Mar 2017 21:45

by Jorge Sousa » 18 Apr 2017 14:16

Hello

About

only Column_1 cell changes !!, does i missed something ???


I don't know how are Column_2 and Column_3 are configurated, and what is the value of SomeData

try with Column_2.Name instead of .Index

2- second issue is difficult to explain but i'll try :
if Column_1 is adjacent to Column_0 ==> enter value to Column_0 then pressed enter ==> you will see a strange behavior (i can not describe)


I can't imagine what strange behaviour could that be, without a proper test case.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by fateh78 » 18 Apr 2017 14:55

all columns are the same config
now a test case is a must
i'll try to send today
fateh78
 
Posts: 85
Joined: 16 Mar 2017 21:45

by Jorge Sousa » 18 Apr 2017 14:59

Thanks
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

Previous

Return to JQGrid

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.