如何使用jquery更新jqx网格

时间:2014-03-08 10:09:46

标签: javascript jquery

$.ajax({
             url: "RequestHandler?usercommand=showcriticaldatezone&useraction=ShowUserPreferenceDashbord_frm&subCommand=criticaldatezone",
             type: 'POST',
             dataType: 'json',
             data: dateText,
             contentType: 'application/json',
             async:'false',
             cache:'false',

             success: function (data) {                     
                var parsedJSON = JSON.parse(data);
                var tempdate;
                alert("parse json  - "+parsedJSON.length);
                js= [];

                 for (var i=0;i<parsedJSON.length;i++) {
                  alert(" critical date is -:"+parsedJSON[i].CriticalDate);
                  js.push(parsedJSON[i].CriticalDate);
                //tempdate='{"Date":['+'"'+ parsedJSON[i].CriticalDate + '"' + ']}';
                }
                tempdate='{"Date":'+JSON.stringify(js)+'}';
                alert("stringify is -:"+tempdate);

                selectedDate=tempdate;
                jqxgriddata=data;
                $(this).datepicker("refresh");

                jQuery("#myGrid").setGridParam({ 'data':  data}).trigger("reloadGrid");

                alert('sucess!');

             },
             error:function(data,status,er) {
                 alert("error: "+data+" status: "+status+" er:"+er);
             }
         });

我使用上面的代码刷新网格后服务器响应但不成功我使用jqx网格服务器响应是json数组我能够第一次显示网格但不能刷新它请帮助

0 个答案:

没有答案