jQWidgets Forums

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: Virtual Model Default Filter Virtual Model Default Filter #98546

    jeffo
    Participant

    Thank you for the response, however for anyone who would like a direct answer as opposed to an easter egg hunt to find it, here is what I managed to get working…

    var isFalseFilter = function(){
                var jqxFilter = new $.jqx.filter();
                var isFalseFilter = jqxFilter.createfilter('booleanfilter', false, 'EQUAL');
                jqxFilter.addfilter(1, isFalseFilter);
                return jqxFilter;
            }();

    (Notice the extra ‘()’ after the function. The Filter must be returned as a function, hence the additional brackets that I missed for ages!

    Then as per the documentation define the column (I define my columns in html and pass them in via a binding)…

    {text:'Deleted', columntype:'checkbox', datafield:'Deleted', filtertype:'bool', filter:isFalseFilter}

    Hope this saves someone some time.


    jeffo
    Participant

    Sorted! Thanks!

    in reply to: Error Filtering Grid Error Filtering Grid #93599

    jeffo
    Participant

    Its ok 🙂

    Someone (who shall remain nameless but was NOT me), put filtertype: ‘none’ in the list of columns instead of using filterable: false. For some reason it never complained until there was actually any filters applied.

    thanks.


    jeffo
    Participant

    Is it possible to bubble up the mouse events? Or implement the above functionality within a widget?

    thanks.


    jeffo
    Participant

    Its OK. I seemed to have sorted it.

    I have implemented initwidget,

    initwidget: function (row, column, value, cellElement) { 
      var $el = $(cellElement);
    
      $el.removeClass('jqx-grid-widget').addClass('jqx-grid-cell-left-align').attr('style', '').css('margin-top', '4px').empty().append($('<a />').attr('href', 'http://www.someaddresshere.com').html(value));
    }

    However, row seems to be inconsistent in implementation between containing row id and row object.


    jeffo
    Participant

    Peter

    As an update I managed to achieve what I wanted by removing the createwidget and initwidget methods to enable the cell to access edit mode. I format the html in cellsrenderer and manage the click (if required) in cellbeginedit. cellbeginedit either handles the click event, and returns false to prevent the edit, or returns to enable the cell to transition to edit mode automatically.

    I hope this is an acceptable method, because it (seems) to be working as expected.

    thanks.


    jeffo
    Participant

    Thanks Peter.

    I am using knockoutjs to bind the data; and cellsrenderer to define html for my custom button (or data if it isnt null). createwidget sets the click event of the button to update the date, and call updatebounddata to update the grid. initwidget is empty.

    Can you please suggest where in the javascript the cell is set to edit mode? Perhaps I can implement something external to the grid to switch modes when the date is displayed as opposed to the button? (to give my client what they are asking for)

Viewing 7 posts - 1 through 7 (of 7 total)