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条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 有人用过颜色传感器吗?
      • ¥50 求一个SQL长料切短料的优化排版算法
      • ¥15 python 删除TXT文档中小写字母
      • ¥15 ValueError: not enough values to unpack (expected 2, got 0)
      • ¥15 js怎么禁止修改域名
      • ¥15 Cursor为什么在Windows11打不开
      • ¥30 java调用javacv遇到的问题
      • ¥15 如何使用matlab画出带宽100Khz,时长100ms信号的LFM形式的时频图啊
      • ¥15 Error: [BABEL]: Cannot find module '@vue/babel-preset-app'.报错,求解
      • ¥15 --==关于启动加载mount命令的解决方案==--