EasyUI Forum
December 07, 2025, 11:22:16 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / How to use the loadData method for datagrid on: December 15, 2011, 09:00:26 AM
Hi All,

I need an example on how to use the loadData method for the datagrid that is in the file jquery.datagrid.js??

Any and all help is greatly appreciated.

I have the datagrid being created and the columns added but I now want to add the JSON data to the datagrid.

Thank You,

Jim
2  General Category / EasyUI for jQuery / Re: How to request the json data from an IIS server using .Net on: December 14, 2011, 09:18:25 AM
Here is my code in the aspx page.  It is getting to it as I can see in the log file that it gets the JSON data and I validated it.

Code:
string jsonString = new JavaScriptSerializer().Serialize(fields);
mlog.Info("Here is the JSON String ==> " + jsonString);
Request.ContentType = "application/json; charset=utf-8";
Response.Write(jsonString);

Here is the code to call the datagrid:
Code:
        var frozenColumns = "[[{field:'MappingFieldID',title:'MappingFieldID',width:100,align:'center'},{field:'Field',title:'Field',width:100,align:'left'}]]";
        var columns = "[[{field:'Screen',title:'Screen',width:80,align:'center'},{field:'ErrorMessage',title:'ErrorMessage',width:160,align:'left'},{field:'IsRequired',title:'Is Required',width:100,align:'center'},{field:'TableName',title:'Table',width:80,align:'center'},{field:'ValueType',title:'Value Type',width:80,align:'center'},{field:'FieldId',title:'Field Id',width:100,align:'center'},{field:'Description',title:'Description',width:140,align:'left'},{field:'Schedule',title:'Schedule',width:140,align:'center'},{field:'EditChecks',title:'Edit Checks',width:140,align:'center'},{field:'FieldCalculations',title:'Field Calculations',width:140,align:'center'}]]";
        $(function()
        {
            $('#GridTable').datagrid({
                width: 600,
                height: 350,
                nowrap: true,
                striped: true,
                collapsible: false,
                url: 'GetJSONData.aspx',
                //sortName: 'Field',
                //sortOrder: 'asc',
                idField: 'MappingFieldID',
                fitColumns: false,
                frozenColumns: eval(frozenColumns),
                columns: eval(columns),
                pagination: false,
                rownumbers: false
            });
        });
It loads the table but only the table columns and it shows the "processing while loading" then it stops and I don't know what happens..

Any ideas if this is the correct way to load the JSON data from a .net page?

I also have another way using a webmethod to get the JSON data but how if I have the JSON data could I load it into the datagrid??

Any help either way would be great!!

Thanks,

Jim
3  General Category / EasyUI for jQuery / How to request the json data from an IIS server using .Net on: December 13, 2011, 11:35:29 AM
Hi,

I see plenty of examples of loading the json data through a static file. How do we load the datagrid if we need to make a call to the server to get the json data?

An example using jQuery would be great?

Thanks,

Jim
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!