Forum


23:28

18/04/2011

Hello,
I have created my grid and user with success the edit, add and delete without issue, but of my 3 grids, one is pulling data from a table with related fields in another table, which needs to populate a proper dropdown box when editing.
Now I am using XML when creating the grid, but am having trouble finding the proper way of creating the select dropdown. It seems that most are using JSON.
Question, should I switch from XML to JSON, or is there an tutorial or set of instructions to use XML and sql to create the proper select dropdown.
Thanks,
Ray
20:34

18/04/2011

Ok, JSON or XML, it doesn't really make a difference, there doesn't appear to be any example showing how to populate the drop down select box with dynamic data.
That is, not to have the simple data listed in the grid options.
What I have is simple, a list of products, suppliers and product categories. Suppliers and Product Categories are simple lists from the database, Products include supplier id and category id, but display in the grid with product name, supplier name and category name.
What I need is a dropdown which will include the supplier id and name, which will be selectable when doing a form edit.
But I find no examle of how to properly create that select dropdown, and populate it with proper values.
I need your help, and a simple tutorial on how to do this properly. unfortunately I cannot find one.
Ray
08:02

Moderators
30/10/2007

Hello,
It seems to me that you do not read the documenation and do not go throught all examples into the demo.
http://trirand.com/blog/jqgrid.....qgrid.html
Are you sure you have check all the examples?
Please go to demo:
http://trirand.com/blog/jqgrid.....qgrid.html
Open the "New in version in 3.5″ item and then select "Form Improvements"
Enjoy
Kind 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.
16:04

18/04/2011

Yes, I read the entire documentation, and looked at that particular info for the new improvements, however,it states simply:
editoptions:{dataUrl:'test.txt', defaultValue:'Intime'},
Which does nto really tell the format of the info in test.txt, if it's in json or not, although another website does specify to enter the information in semicolon separated data:
{"Countries":{"Content":"230:UNITED STATES;40:CANADA;7:AFGHANISTAN;etc..... }}
However, it does not specify it this is to be json encoded (which I assume, but does not work)![]()
So, to refresh, format for the test.txt file is not specified, if it is I cannot find it. I believe this should be correct,
but is not working correctly for me.
foreach ($query->result() as $row)
{
$response->rows[$i]['id'] = $row->id;
$response->rows[$i]['cell'] = array($row->id,$row->supplier_name);
$i++;
}
echo json_encode($response);
Is this correct and simply an error in my part, or is the encoding for the dropdown (test.txt) not json?
Thanks,
Ray
22:07

Moderators
30/10/2007

Helllo,
Yes, I read the entire documentation, and looked at that particular info for the new improvements, however,it states simply:
editoptions:{dataUrl:'test.txt', defaultValue:'Intime'},
Which does nto really tell the format of the info in test.txt, if it's in json or not, although another website does specify to enter the information in semicolon separated data:
Sorry to say, but it is not true. Did you read this?
http://www.trirand.com/jqgridw.....;s=dataurl
Look at datUrl parameter at middle of the page.
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:
54 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