jQuery UI Widgets Forums Grid Are widgets using createwidget cached

This topic contains 4 replies, has 2 voices, and was last updated by  Peter Stoev 8 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author

  • lorenzopt
    Participant

    It seems that’s not the case as I notice performance degradation when more rows are rendered. Were using it to create emberJS components and add them to grid cells. Here’s the code:
    createwidget: function(row, column, value, htmlElement){

    if(value === ‘jqxgrid-multiselect’){

    var componentObj = {};

    componentObj.name = ‘jpma-multiselect’;
    componentObj.type = ‘component’;
    componentObj.singleColumn = ‘singleColumn’;

    var props = [];
    props.push({key: ‘content’, value: [{
    code: ‘option1’,
    value: ‘Option 1’
    }, {
    code: ‘option2’,
    value: ‘Option 2’
    }
    ]});
    props.push({key: ‘optionValuePath’, value: ‘code’});
    props.push({key: ‘optionLabelPath’, value: ‘value’});
    props.push({key: ‘dropdownLabel’, value: ‘selectedItem’});
    props.push({key: ‘placeholder’, value: ‘selectedItem’});
    props.push({key: ‘selectedValue’, value: ‘selectedItem’});
    props.push({key: ‘showOptions’, value: ‘false’});

    componentObj.props = props;

    var component = $this._createComponent(componentObj);
    component.set(‘htmlElement’, htmlElement);

    component.on(‘didInsertElement’, function() {
    var subComponentElement = this.get(‘element’);
    this.$(subComponentElement).addClass(‘fill-container show-block’);
    this.$(subComponentElement).appendTo($(this.get(‘htmlElement’)));
    });
    component.append();
    }
    },
    initwidget: function(row, column, value, htmlElement){
    /* jshint unused:false */
    }


    lorenzopt
    Participant

    Oh, and I should probably say that we are using virtualmode.

    Are widgets using createwidget cached #83080

    Peter Stoev
    Keymaster

    Hi lorenzopt,

    Yes, they are cached and you should update them in initwidget callback function. Also the performance depends much on how these custom widgets are used, created, updated from your code, too.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    lorenzopt
    Participant

    Thanks for the reply. Do you have an example of how to use initwidgets? I haven’t been able to find one on the site.
    Thanks again


    Peter Stoev
    Keymaster

    Hi lorenzopt,

    We have one Grid sample about createwidget and initwidget on our website. The link to this Grid example is: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/customwidgetscolumn.htm?light

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.