searchPanes and serverside render

searchPanes and serverside render

we0038we0038 Posts: 45Questions: 15Answers: 1

I have a column is_colsed ** which has a value of either **0 or 1
in my table, I render the value to some icon which also render fine in the searchPanes. However, once I set my table to serverSide the serchPanes shows 0 and 1

After some research, I used searchPanes options like this

{
        searchPanes: {
          show: true,
          options: [
            {
              label: 'Closed',
              value: function (rowData, rowIdx) {
                return rowData.issue.is_closed == 1;
              }
            },
            {
              label: 'Open',
              value: function (rowData, rowIdx) {
                return rowData.issue.is_closed == 0;
              }
            }
          ]
        },
        targets: [8]
},

However, the filter does not work properly with options!

Any suggestion is appreciated.

Answers

  • we0038we0038 Posts: 45Questions: 15Answers: 1

    It worth mentioning that I also tried setFormatter and getFormatter
    like this

    Field::inst( 'issue.is_closed' )
          ->getFormatter( function ( $val, $data ) {
            return $val ? 'Closed' : 'Open';
          })
          ->setFormatter( function ( $val, $data ) {
            return $val=='Closed' ? 1 : 0;
          })
          ->searchPaneOptions( SearchPaneOptions::inst()),
    

    but that didn't work either

Sign In or Register to comment.