Forum


16:17

16/09/2008

Great grid Tony. I have configured the grid for an app pretty good but I have a few questions I can not find the answers to in the docs or here.
1. Userdata Totals
Using the New in version 3.1, Toolbars and userdata example I am trying to use this with json.
var udata = $(â€#a_allâ€).getUserData();
$(â€#t_a_allâ€).html(â€
}
$response->total = $total_pages;
$response->records = $count;
$response->t_wins = $t_wins;
This bulds the json string as:
{â€pageâ€:â€1″,â€totalâ€:3,â€recordsâ€:â€21″,â€t_winsâ€:â€3509″,…..
But the totals bar shows: Totals Wins:undefined.
Is this a problem with my javascript or php?
2. Change Cell Colors
I have successfully used the afterInsertRow:, setCell function to change the colors of cells. There are about 10 columns though and with a 10 row grid this is a lot of extra code.
I am wondering if this is efficient or if the cell coloring should be done on the php side and passed via the json string?
Note I can’t use row coloring as cells can be different colors for each column.
3. Dynamic Height of Grid
I have the following:
rowNum:10, rowList:[10,20,30], height:185,
This works fine as all 10 rows are shown with no scroll bars. If I change the rowlist on screen to 20 the grid stays the same size but adds scroll bars so that the full 20 rows can be seen. This scroll bar eats into screen real estate so is it possible to dynamic change the height to 370 if 20 rows is selected?
4. Links in Cell Breaks Edit
One of the column has clickable links so that users can go to a new page. This works in that clicking a cell will open the link but it breaks the editing. Rows with links in produce edit page:
Edit Record, Submit Cancel
No data is displayed.
The json file is:
I tried wrapping in <![CDATA[ ]] but that does then not render the column correctly.
TIA.
05:03

Moderators
30/10/2007

Hello,
Step by Step:
1. The expression $response->t_wins = $t_wins; is wrong.
The right is
$response->userdata = array('t_wins'=>$t_wins,...);
2. If every cell should have diffrent color this is the right way,
but it depend how many cells do you want to color. Of course if
they are too much I think the better way to do that is server side.
3. Set the option (as of the docs) height: '100%', but I recommend
to use height:'auto' which work crossbrowser. The '100%' does not
work correct in Safari.
4. You are right about this, but we need in this case a cell editor.
This is not trivial work. If you use formedit I recomend you to add a
extra hidden column with the value of the link column. Make link column
not editable, but set for the hidden column: editrules:{edithidden:true}
If you use reloadAfterSubmit: false then you should manully update the
link column using maybe afterSubmit event.
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
82 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66