언어 설정

Menu
Sites
Language
TAU setNSData do not work...

I want to change button's Icon to top.. and make code two ways... 

jQuery Code do work good.. but tau setNSData do not work...

jQuery Code 

        $("#button1").button("option", "iconpos", "top");
        $("#button1").button("refresh");

TAU Code 

        var button1Element = document.getElementById("button1");
        var button1 = tau.widget.Button(button1Element);

        tau.util.DOM.setNSData( button1Element, "iconpos", "top" );  // or (tau.util.DOM.setAttribute( button1Element, "data-iconpos", "top" );

        button1.refresh();

There is no script error!!.. but  jQuery can move  Icon to top. but Tau can't do it..

I debug it and i find the button1's attribute' change works good.. but button1's class' is not changed...   what is tau's formal way?

 

Anyone who know...

 

Thanks..

 

Edited by: 병옥 이 on 23 11월, 2014

Responses

3 댓글
병옥 이

I find a way.. 

        button1.options.iconpos = "top";
        button1.refresh();

But, Is this a TAU's Formal way??? 

Anyone who knows ???

Konrad Lipner

Yes it is :) You can also:

var button1 = tau.widget.Button(button1Element, {iconpos:"top"});

in widget constructor you can pass options. Then you don't have to call refresh and waste app run time. :)

Konrad.

병옥 이

thank you..