• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Create empty typed JSON object?

You can't, perhaps JSON isn't the most appropriate notation for your problem?

OK. The problem domain is this :

Client wants Grids on a form. The Grids represent hierarchical data. It must be possible to manipulate the Grids (add and delete parent and child rows) without persisting any data to the database tables until the form is submitted.

So this means I have to maintain a DataTable per grid in memory.

There is some GUI logic that says if the "Count" column of the Parent row does not have the correct number of child records then prevent form submission and display some client side validation.

Owing to the constraints of the BPM framework, this can only be done on the client side. So I need to effectively keep a client side copy of the DataTable.

JSON looked like a good approach. If you have to create JSON objects prepopulated with garbage then I agree, they are not what I need.

What would be a better client side technology? I wanted to stay away from basic arrays. JSON had lots of cool stuff baked in to decorate the columns with constraints which I liked.
 
OK. The problem domain is this :

Client wants Grids on a form. The Grids represent hierarchical data. It must be possible to manipulate the Grids (add and delete parent and child rows) without persisting any data to the database tables until the form is submitted.

So this means I have to maintain a DataTable per grid in memory.

There is some GUI logic that says if the "Count" column of the Parent row does not have the correct number of child records then prevent form submission and display some client side validation.

Owing to the constraints of the BPM framework, this can only be done on the client side. So I need to effectively keep a client side copy of the DataTable.

JSON looked like a good approach. If you have to create JSON objects prepopulated with garbage then I agree, they are not what I need.

What would be a better client side technology? I wanted to stay away from basic arrays. JSON had lots of cool stuff baked in to decorate the columns with constraints which I liked.

What are you using here? .NET ,JAVA, Python ,LISP?
 
Why does it matter? :confused:

Sorry I read grids on a form and thought it was some windows client, my mistake sorry. I'm out of ideas I would do as jmo1 suggests and ask on StackOverflow.
 

I'm busy so just scanned it, missed the part you mentioned this is a web app. I am so sorry. Because of that I will only charge half a days rate.
 
And he's back databinding to nested arrays........

:rollin:
 
JSON is javascript and javascript is prototype based and supports dynamic typing. Next !
 

Advertisers

Back
Top