Query |
Response | |
1. How can I prevent the above error message in the supjetc for huge data? |
To avoid the issue please find the steps.
i) we have used the default MaxJsonLength value (2097152 characters, which is equivalent to 4 MB of Unicode string data) of the JavaScriptSerializer which is a fixed universal standard length for serializing the data.
Please find Custom datasource serializer class will be as follows.
ii) To use ej.Webmethod Adaptor. Please find the link.
| |
2. How can I prevent a whole reload of the page, so that only the grid is refreshed with the data after presing the button
|
if we are using ej.WebMethod Adaptor , we need to handle sorting, filtering or paging in server side. So grid automatically post back occurred. this is default behavior
|
<ej:Button ID="btnInsert" Type="Button" runat="server" Text="Update" ClientSideOnClick="btnclick" ></ej:Button>
<ej:Grid ID="Grid" runat="server" AllowPaging="True" AllowTextWrap="True"
ShowStackedHeader="True"
AllowScrolling="true"
AllowFiltering="true"
AllowResizeToFit="true"
Selectiontype="Single"
>
<Columns>
.
.
</Columns>
</ej:Grid>
<script type="text/javascript">
function btnclick(e) {
var data = ej.DataManager({
url: "/Default.aspx/DataSource",
adaptor: new ej.WebMethodAdaptor()
})
var query = new ej.Query();
var execute = data.executeQuery(query)
.done(function (e) {
var data = e.result;
var obj = $("#MainContent_Grid").ejGrid("instance");
obj.dataSource(data.result);//bind the data for grid
});
}
</script> |