Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call the repaint() method?

Tags:

phonejs

Need a code example of repaint() method for dxList widget in Phonejs

NB: I want to call repaint() after a user action such as click.

like image 672
prium Avatar asked Jul 06 '26 20:07

prium


1 Answers

Use the "repaint" method in the following manner:

<!--TRIGGER-->
<div data-bind="dxButton: { text: 'repaint dxList', clickAction: onClick }"></div>

<!--TARGET LIST-->
<div id="targetList" data-bind="dxList: { width: 100, dataSource: [{ key: 1, title: 'element_1'}, { key: 2, title: 'element_2' }, { key: 3, title: 'element_3' }] }">
    <div data-bind="dxAction: '#itemDetailsViewName/{key}'" data-options="dxTemplate : { name: 'item' } ">
        <div data-bind="text: title"></div>
    </div>
</div>

onClick: function () {
       var list = $("#targetList").dxList("instance");
       list.option('width', 200);            
       list.repaint();
}
like image 150
Mikhail Avatar answered Jul 09 '26 09:07

Mikhail