Saturday 15 August 2015

date - jqgrid read in embedded json objects -


O people, that's why I am currently using jqgrid with jsongrid data and it reads right now, but I'm getting some problems object to read in the grid, so my JSON data looks like this: <"total": 1, "page": "1", "record": 1, "lines": [{"cell 1": 1, "cell2": "stuff" , "Cell 3": {"Date": "2013-06-02 10:56:00", "Timezone_type": 3, "Timezone": "UTC"}}}} < P> Does anyone know that I have a part of the data in cell 3 How to read and interpret it as just how to get jqgrid, to display date and time?

My current Jasonson reader is as follows:

  jsonReader: {Route: "Rows", Page: "Page", Total: "Total", Archive: Record ", Repeats: Wrong, ID:" 0 "}   

Thanks again everyone

First of all options JsonReader: {repeatitems: false, id:" 0 "} are incorrect Use default duplicates: true In the case the integer values ​​of id can be used. In this case, the data array representing the line of the grid looks like ["1", "Cell2"] and not in the form of an object with the name property {"Cell1": 1, "Cell2": "luggage"} . You should use the jsonReader: {repeatitems: false, id: "cell1"} if Cell1 contains the value you have unique id As the line of the grid you want to use.

Now go back to your main question. I suggest you to change the format of the data from "rows":

  {"total": 1, "page": "1", "record": 1, {"Cell 1": 1, "cell2": "luggage", "cell 3": {"Date": "2013-06-02 10:56:00", "Timezone_type": 3, "Timezone": "{1" Cell 2 ":" Goods "}]," User "," UTC "}}}}," Page ":" 1 "," Record ": 1," Rows ":" Data ": {" 1 ": {" Date ":" 2013-06-02 10:56:00 "," Timezone_type ": 3," Timezone ":" UTC "}}}   

I want to comment on your suggestion It is also clear to other users. Column Cell1 contains the id structure of user data which I recommend that the queue (value of Cell1 ) and Custom information that you call "Cell3" .

If you need "cell 3" value from anywhere in your code, then the code will be as below

  on selectRow: function ( Rully) {var Cell 3 = $ (this) .jkgrate ("Getgraig Para", "User Data") [Roly]; // Now you can use cell 3 which makes the key such as "//", "2013-06-02 10:56:00", // "timezone_type": 3, // "timezone": "UTC" //}}    

No comments:

Post a Comment