Search code examples
jqueryjqgrid

jqgrid guriddo - how to get all data after processed


Is it possible to return all data from my jqgrid??

This work great but I only get clear data.

this.element.jqGrid('getRowData')

For example I have column approved with settings:

   {
        editoptions: {value: "t:Yes;f:No;null:No"},
        value: "t:Yes;f:No;null:No",
        edittype: "select",
        formatter: "select",
        index: "approved",
        label: "Approved",
        name: "approved",
        resizable: false,
        search: false
    }

When I use "getRowData" I get value for this column "f" but I need "No".

I looked into documentation and I didnt find method which gave me data after processed only clear data.

Is there a way to do this?


Solution

  • If your data comes from the server only and you want to get the text from select you will need to define your own custom unformat function. like this:

    {
            editoptions: {value: "t:Yes;f:No;null:No"},
            value: "t:Yes;f:No;null:No",
            edittype: "select",
            formatter: "select",
            unformat : function( cellval, options, cell) {
                return cellval;
            },
            index: "approved",
            label: "Approved",
            name: "approved",
            resizable: false,
            search: false
        }
    

    and use the getRowData as of your code

    in case of loadonce true or local datatype parameter you will nedd to query the data parameter

    $("#jqGrid").jqGrid('getGridParam', data);
    

    or to use the second parameter in getRowData to return tha data array

    this.element.jqGrid('getRowData', true);