Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Dynamic Columns - JSON vs XML
10/05/2011
23:28
Avatar
Ray Dube
Member
Members
Forum Posts: 7
Member Since:
18/04/2011
sp_UserOfflineSmall Offline

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

12/05/2011
20:34
Avatar
Ray Dube
Member
Members
Forum Posts: 7
Member Since:
18/04/2011
sp_UserOfflineSmall Offline

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

13/05/2011
08:02
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

13/05/2011
16:04
Avatar
Ray Dube
Member
Members
Forum Posts: 7
Member Since:
18/04/2011
sp_UserOfflineSmall Offline

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
13/05/2011
22:07
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

13/05/2011
22:36
Avatar
Ray Dube
Member
Members
Forum Posts: 7
Member Since:
18/04/2011
sp_UserOfflineSmall Offline

Hello Tony,

Sorry, i must have missed that, saw most everything else, except for that item.

So, not json formatted, but standard html select element.  I will try and advise if there are any issues.

Thank you,

Ray

13/05/2011
23:55
Avatar
Ray Dube
Member
Members
Forum Posts: 7
Member Since:
18/04/2011
sp_UserOfflineSmall Offline

Just a quick note to say thank you Tony for pointing me in the correct directions, the grid is working as perfectly as I should have had it had I spotted those items I missed.

Thanks for your help!

Ray

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information