Login Register

json

ItemFileReadStore and Dijit.Tree Json formatting issue

I'm using the dijit.Tree control with an ItemFileReadStore to populate the tree from a .net WCF restful web service returing JSON. Problem is that the items array of object I'm returning has to have a children array whether it's populated or not. This serializes to "children":null.

dijit.Tree data collision error help

Hi,

I'm fairly new to dojo, and searched for similar postings but hit an impasse. Perhaps someone here could help or at least point me in the right direction.

I'm using dojo version 1.1.1 to construct a dijit.Tree; however, I receive the following collision error when children nodes (with different parents) contain the same "name":


{tree} : error loading root children: [ Error: dojo.data.ItemFileReadStore: The json data provided by the creation arguments is malformed. Items within the list have identifier: [name]. Value collided: [D] ]

JsonRestStore - How do I use it?

I am a little confused by how all of this works.

If I have a URI [/userstatus] that has a
(GET) getStatus() (returns status of all users in the format { {"A","aCTIVE"}, {"B","Not at desk"}}
(PUT) setStatus(String userName,String Status) (updates status of the particular user)

How do I implement a JSONRestChannel that pub/subscribes to /userstatus
such that all clients get updated (with a GET request) whenever a client "PUT"s a request to the /userstatus?

I am using the following code

//Server Side
...
@Singleton
@Path("/userStatus")

public class UserStatus {

@GET

Bringing PHP, MySQL, and Dojo together

I made a pact that I’d add documentation on how to use PHP, MySQL, and Dojo together, when finishing the Dojo ItemFileReadStore demo. It’s not easy to format a JSON specific file with PHP, which includes special characters and requires JSON members. With several PHP JSON encoders out there, I recommend using the PHP encoder which came bundled with the toolkit (dojo/tests/resources/JSON.php).

HTML and dojo widget in a string returned from Ajax-PHP response

I'm fine up to the point of returning data from the server and changing the HTML tag's innerHTML, but the Dojo widget embedded in the HTML is disabled (inline edit, to be specific). I'm guessing I have to reparse the widgets coming from the server response. My code's fine. All I need to know is how do I parse a widget copied in, not created programmatically?

xhrPost, xhrGet, RPC or json?

Hi,
I couldn't find any comparison article or discussion on pros and cons on different types of data transfer procedures (I mean xhrPost, xhrGet, RPC, json etc).

Please suggest me which data submission procedures will be better,efficient and secure and in a word PERFECT for the following situations seperately-

1. Login
2. User registration
3. Live data update in Grid

Thanks a lot in advance.

Rendering the grid programaticaly and loading data into it through a json file created via a servlet

I want to render the grid such that the row and column headers are formed dynamically and also its contents are populated. The JSON object is available via a AJAX call. My aim is to create the grid with the help of this JSON object i get. What will be the right store to use ..eg. ItemFileReadStore,QuerryReadStore,..etc. I have to achieve this my calling the servlet only once in the AJAX call.

Here is my code

dojo11.addOnLoad(function(){

var jsonObject;

getvalue from json child array

I am using a dojo datastore to get data from server. The result json data looks like this:

"results":[{"Description":"desc","Introduction":"intro","ListingID":"150285806144","ListingType":0,"imagelist":[{"imgname":"", "imgurl":"url"},"imgname":"", "imgurl":"url"}],
"itemid":104,"location":"","price":0,"title":"title","url":""},{"Description":"","Introduction":"","ListingID":"370080509516","ListingType":0,"imagelist":[{"imgname":"", "imgurl":"url"},{"imgname":"", "imgurl":"url"}],

Can the ContentType of an dataStore be set?

I am connecting a dataStore to a url created by TurboGears (1.x) with a Kid templating system. The way turbogears exposes the controllers (the URIs), the same controller can supply the Kid generated template or JSON data, and that is controlled by the ContentType of the request. So, to get JSON returned, I need the content type of my dataStore request to be: "text/javascript". I see it is application/url-form-encoded (something like that) but I don't see how, or if it's possible to, change the dataStore contenttype.

dojox.collections.Dictionary: retrieve JSON string

I'm creating a multi-dimensional dictionary collection during runtime. How can I retrieve the native JSON structure (in a string) after the dictionary is build?

Syndicate content