Title: Add a new easyui-switchbutton to s ul Post by: kayjay on February 14, 2017, 10:02:59 AM I have this html snippet taken from one of the mobile tab demos.
Code: <!--Second Tab--> I have this js code inside the ready function: Code: $('#main_list').append('<li><span>NewListItem</span><div class="m-right"><input id="sb3" class="easyui-switchbutton"></div></li>'); When this loads I get a new list element but instead of an "easyui-switchbutton" I get a "text input box" instead. Should I expect this to work ror have I got it all wrong? Title: Re: Add a new easyui-switchbutton to s ul Post by: stworthy on February 15, 2017, 01:37:53 AM You have to create the switchbutton after appending the elements.
Code: $('#main_list').append('<li><span>NewListItem</span><div class="m-right"><input id="sb3" class="easyui-switchbutton"></div></li>'); Title: Re: Add a new easyui-switchbutton to s ul Post by: kayjay on February 15, 2017, 02:48:08 AM Thank you so much - that does the trick. Silly me.
|