PDA

View Full Version : [CLOSED] Json max length



matrixwebtech
Aug 04, 2014, 4:32 AM
Currently I take value from gridpanel on button direct event with bellow code.


de.Click.ExtraParams.Add(new Parameter
{

Name = "values",
Value = "Ext.encode(#{GridPanel1}.getRowsValues())",
Mode = ParameterMode.Raw
});

its give a JSON format data in code behind



[{"MaterialCode":"MOB","ReqMaterialID":0,"MaterialCatergoryID":2,"MaterialID":1,"UOMCode":2,"AvaiableStock":2,"RequireQTY":0,"Moveing_Average_Price":200,"TotalValue":0},{"MaterialCode":"P1","ReqMaterialID":0,"MaterialCatergoryID":2,"MaterialID":2,"UOMCode":3,"AvaiableStock":1,"RequireQTY":0,"Moveing_Average_Price":500,"TotalValue":0}]

please let me know,if the data volume increase then I will not get all records because of MaxJsonLength property,then how I solve this situation.

Vladimir
Aug 04, 2014, 9:13 AM
There is no MaxJsonLength on the client side

matrixwebtech
Aug 04, 2014, 9:38 AM
The property MaxJsonLength not related to EXT.Net its related to Microsoft . I found http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializ er.maxjsonlength%28v=vs.110%29.aspx where I will see The default is 2097152 characters,
but the characters can be increase,can you please advice what I do in this situation

Vladimir
Aug 04, 2014, 10:09 AM
Ext.Net doesn't use Microsoft serializer, so that property will not affect on Ext.Net behaviour

matrixwebtech
Aug 04, 2014, 11:17 AM
thanks for your reply,so now we can transmit any amount of data with JSON,which is very good news.

Vladimir
Aug 04, 2014, 11:28 AM
In any way, i don't recommend to transmit such amount of data because you can easly to break down of browser
I don't know cases when such amount of data to be required,

- do not bind many records to a grid, use remote paging, user cannot operate by thousands records at one time
- if you bind many records then do not send all of them to the server, send back only changed records because non changed records can be retrieved on the server side (from DB or other storages)

matrixwebtech
Aug 04, 2014, 12:31 PM
thanks for your suggestion.
actually I will not use json for display data in grid.

I have an order entry form,in this page I take a grid,user fill this grid and save record,currently I am not worried because now they enter small amount of data like 50-100 rows ,but I think about future then data will be huge may be 500 and more rows and 15-20 columns in grid.can you please advice what is best dos and don's

Vladimir
Aug 04, 2014, 4:40 PM
Well, if all records are added by user then there is no another way
Are you sure that user can add 500 records manually?
In any way, 500 records is not a problem to submit to the server

matrixwebtech
Aug 04, 2014, 7:14 PM
yes ,because previously they do this manually and now they automate there system,so they manually add there old records.and I told 500 or more rows of records in JSON format ,like bellow.this is sample of 2 rows .Is Ext.Net json support set of 500 data like bellow?


[{"MaterialCode":"MOB","ReqMaterialID":0,"MaterialCatergoryID":2,"MaterialID":1,"UOMCode":2,"AvaiableStock":2,"RequireQTY":0,"Moveing_Average_Price":200,"TotalValue":0},{"MaterialCode":"P1","ReqMaterialID":0,"MaterialCatergoryID":2,"MaterialID":2,"UOMCode":3,"AvaiableStock":1,"RequireQTY":0,"Moveing_Average_Price":500,"TotalValue":0}]

Daniil
Aug 05, 2014, 1:39 PM
It is a valid JSON object and Ext.NET should not have any problem with that. If it does, please provide a test case to reproduce it.

matrixwebtech
Aug 05, 2014, 1:52 PM
Thanks for reply.
can be close.