0

Can the control's Properties be modified dynamicly?

Take KONtx.control.Grid for example, I want to change the grid's rows from 1 to 4,the following is the code, looks like this:
CODE
      this.controls.grid = new KONtx.control.Grid({
id: "grid1",
rows: 1,
columns: 1,
styles: {
width: this.width,
height: this.width,
vOffset: this.height - this.width - this.controls.metadata.height - this.controls.pageindicator.height,

},
cellCreator: this.imageCellCreator,
cellUpdater: this.imageCellUpdater,
manageWaitIndicator: true,

}).appendTo(this);

var self = this;
this.controls['button'] = new KONtx.control.TextButton({
label: 'HelloADO',
styles: $merge($content.styles.main.button, {
vOffset: 0
}),
events: {
onSelect: function(event){
[b]
[i][u]self.controls.grid.rows = 4;
self.controls.grid.columns = 4;

self.updateView(); [/u][/i][/b]
}
}
}).appendTo(this);

The code is in the onSelect handlers function.
But it doesn't work.
Any friend can help me to solve the problem? Thanks.

by
3 Replies
  • I don't know if you can dinamycally change the rows/column of a grid after it's been created.
    0
  • Just remove it with:

    CODE
    this.controls.mygrid.suicide();


    and then create a new Grid() as needed. Beware that you will need to very closely manage the focus in the view.
    0
  • QUOTE (WidgetRealm @ Oct 22 2010, 01:00 PM) <{POST_SNAPBACK}>
    Just remove it with:

    CODE
    this.controls.mygrid.suicide();


    and then create a new Grid() as needed. Beware that you will need to very closely manage the focus in the view.



    Hi,

    Could you please tell me where to add this line? (i.e. CreateView or UpdateView?
    0

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets