weixin_33738578 2017-03-08 13:18 采纳率: 0%
浏览 48

在Wordpress中过滤jqgrid

I'm developing a wordpress plugin that uses jqgrid plugin to show a list of elements. This list gets data from ajax request.

I have to buttons to make filters, depending on the button pressed the data in the jqgrid must show only the rows that one column had a value.

When I press the button, I do this:

    var postdata = grid.jqGrid('getGridParam','postData');
    jQuery.extend (postdata,
    {
        filters:'',
        searchField: 'estado',
        searchOper: 'eq',
        searchString: that.text().substring(0, that.text().indexOf("(") - 1)
    });
    grid.jqGrid('setGridParam', { search: filtrar, postData: postdata });
    grid.trigger("reloadGrid",[{page:1}]);

in searchString I pass the text in the button, that matches with the text value i'm looking for in te table.

My problem is that all buttons makes the jqgrid empty, except the first button that is for show all, this button works (but it makes no sense for mi, this button sends in searchString a text that is not in any row at the field 'estado').

estado is the name in the column that I want search:

{ label: 'Estado', name: 'estado', width: 70, height: 'auto', template: myFloatTemplate, datatype: 'html'   },

thanks...

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 双层网络上信息-疾病传播
    • ¥50 paddlepaddle pinn
    • ¥20 idea运行测试代码报错问题
    • ¥15 网络监控:网络故障告警通知
    • ¥15 django项目运行报编码错误
    • ¥15 请问这个是什么意思?
    • ¥15 STM32驱动继电器
    • ¥15 Windows server update services
    • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
    • ¥15 模糊pid与pid仿真结果几乎一样