开发者

binding sql data with jquery grid usin g handler file

i have a jquery grid which has to be binded with values from sql data,

i have the following code where i would get the data to be binded to the grid in "data1 " variable.the problem i dont know how to bind the data to the jquery grid

 $(document).ready(function() {
            var data1 = "";

            $.ajax({
                datatype: 'json',
                url: 'Handler1.ashx?method=Ttest',
                success: function(val) {
                    debugger;
                    data1 = val;
                }
            });


            $('#list').jqGrid({

                mtype: 'GET',
                colNames: ['key_user', 'UserName', 'Status', 'LoggedIn', 'LoggedOut', 'duration'],
                colModel: [
        { name: 'key_user', index: 'key_user', width: 55 },
        { name: 'UserName', index: 'UserName', width: 90 },
        { name: 'Status', index: 'Status', width: 80, align: 'right' },
        { name: 'LoggedIn', index: 'LoggedIn', width: 80, align: 'right' },
        { name: 'LoggedOut', index: 'LoggedOut', width: 80, align: 'r开发者_如何学Cight' },
        { name: 'duration', index: 'duration', width: 150, sortable: false}],


                sortname: 'invid',
                sortorder: 'desc',
                viewrecords: true,
                caption: 'User Time Log Details'
            });

        });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜