Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sunshineme

Pages: [1]
1
Thanks for your tips,I think i know how to solve it . :)

2
     Thanks for your repliy!
     Actully,I have two tabs and a grid container on a WebForm,The two tabs are stand for users gender,one is Male,and anthor is Female,when i click the "Male" tab,i hope get user's info who's gender is Male,and when i switch to the "Female" tab,i want to get user's info who's gender is Female.
    That means i must change paramter's value and send it to server to get what i want.Now my situation is that i tried the method that you suggested me to use the option of postData and send it,but i having not any luck,the grid load data only once...,when i change and click other tab,my call can never reaching the server.
    What i want is that when i switch these tabs,grid can send request to server just like the grid's paging function.I also get some info from http://paramquery.com/pro/tutorial,it seems that i must use the mehtod named "refreshDataAndView"  if i want to reload data from server(loction='romote').And i also tried it in v1.1.3 and it did,so I was really confused,does PqGrid no longer supported this situation in v2.0.4 ? Or any other way i can use to solve my problem ?
    Here is my JS code:
   
Code: [Select]
     function ListGrid(obj) {         
             var _sex=obj;
            //paramters
            var _postData = {"Sex": _sex };
            //url
            var _url = "UserInfo.aspx?action=GridBindList";
            //colM:grid title
            var _colM = [
                { title: "UserID", width: 100, dataType: "integer", dataIndx: "UserID" },
                { title: "UserName", width: 100, dataType: "string", dataIndx: "UserName" },
                {
                    title: "Sex", width: 150, dataType: "integer", dataIndx: "Sex",
                    render: function (ui) {
                        var rowData = ui.rowData;
                        var value = rowData["Sex"];
                        if (value == "0") {
                            return "Female";
                        }
                        else{
                            return "Male";
                        }
                    }
                }
            ];
            PQLoadGrid("#grid_paging", _url, _colM, _postData, 20);
        }
        /*
       a function that it is used to get data into PQ grid from server
       obj_ID:Container ID
    */
        function PQLoadGrid(obj_ID, _url, _colM, _postData, _pageSize) {
            var dataModel = {
                location: "remote",
                paging: "remote",
                dataType: "JSON",
                method: "GET",
                postData: _postData,
                url: _url + "&a=" + new Date(),
                getData: function (dataJSON, textStatus, jqXHR) {
                    return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: dataJSON.data };
                }
            }
            var grid = $(obj_ID).pqGrid({
                width: 900,
                height: 400,
                collapsible: false,
                dataModel: dataModel,
                colModel: _colM,
                freezeCols: 0,
                wrap: true,
                hwrap: false,
                numberCell: { resizable: true, width: 30, title: "No" },
                oddRowsHighlight: true,
                columnBorders: true,
                pageModel: { type: "remote", rPP: _pageSize, rPPOptions: [20, 50, 100] },//, strRpp: "{0}",
                editable: false       
            });
        }
   
   And html code as below:
   
Code: [Select]
      <div onclick="ListGrid(0)">Female</div>
      <div onclick="ListGrid(1)">Male</div>
      <div id="grid_paging" style="margin-top: 1px;"></div>
   
  Looking forward to your reply !

3
Hi,
I have a problem about my grid, the first time when i get data into PQ grid from a asp.net web form ,it succeeded and displays data.But  when i change some paramters in url and send url to  server again,my call is never reaching the server,and it executes a function in  pqgrid.dev.js,the name of the function is "fn._setOptions",then it returns. I would appreciate if you could tell me where I am going wrong.

Pages: [1]