szenczi
Posts: 67
|
| Posted: 03/14/2008, 2:06 AM |
|
Hi,
I'd like some help.
I've got a grid and an editable grid. The grid has a link to the same page with a link parameter. The editable grid shows that rows which are correspond to this parameter. It work fine.
But! How can I change my grid if it contains only one row the editable grid automatically represent the associative rows (without clicking on the link)? Which is the right method?
Thank you,
Norbert
_________________
CCS5.1, PhP, MySQL |
 |
 |
wkempees
Posts: 1679
|
| Posted: 03/14/2008, 5:24 AM |
|
Nice one.
First user experience:
The page is entered, the grid has 5 rows on it, what is the editable grid displaying at that moment?
Now think about the grid containing only 1 row, what does the editable grid display?
Your user wants consistency, to alway see what he/she expects.
So I would go for initialy always have the editable grid show either nothing until a grid row is clicked OR initialy show data related to the first row of the grid, which would solve your objective.
To have the editable grid show nothing until gridrow clicked you would make the editablegrid's SQL default to a non existent value for the Where (like -1).
To have the editable grid default to the grids first row, you would have to feed the editablegrid's parameter the value of the grids first row linking datafield.
That you could pickup in the Grid's beforeshow or beforeshowrow where index =1, and create a dummy URL parameter to trigger the editablegrid.
Hope this makes sense.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
szenczi
Posts: 67
|
| Posted: 03/14/2008, 5:47 AM |
|
Now, the grid and editable grid works as you mentioned. (The default parameter value is -1 and the rows are diplayed only if the user is clicked on.)
This dummy url not fully clear to trigger the editable grid. How do you think this?
_________________
CCS5.1, PhP, MySQL |
 |
 |
wkempees
Posts: 1679
|
| Posted: 03/14/2008, 6:13 AM |
|
Well, as the page initially loads (assume no Ajax )
your grid is filled with data, and the editable grid is empty because of the -1.
Study the URL that is showing at that moment.
Next click on row1 of the grid, the editgrid will show rows, study the URL at that moment.
My next move would be to add code to the beforeshow of the grid.
test for the number of rows
if number of rows =1
build the URL parameters needed for the editable grid with the correct ID
add them to the url
OR set a session variable, in which case you will have to tell the editablegrid's Where clause to look for the session var
something like that.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
szenczi
Posts: 67
|
| Posted: 03/14/2008, 6:20 AM |
|
I understand...
Thank you!
Norbert
_________________
CCS5.1, PhP, MySQL |
 |
 |
|