jQWidgets Forums

jQuery UI Widgets Forums Editors Input, Password Input, TextArea, ColorPicker, Rating, TagCloud, Loader jqxInput – need help with a solution for dynamic rendering

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 10 months ago.

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

  • asuyhayda
    Member

    Hello.

    I have a program where I am generating controls dynamically based on database entries. I’ve tried creating an input box from javascript with the following code (just as a POC) but it is resulting in odd behavior.

    var html = “”;
    html += “”;
    $(“#jqxwidget”).html(html);
    $(“#adam1”).jqxInput(
    {
    theme: ‘metro’,
    width: ‘250px’,
    height: ’25px’
    });

    This code renders two input boxes to the browser (one right next to the other).. presumably the two input boxes are the jqx “Skin” and the actual html text box.. since the other controls work with divs.. I am able to make those work, but this one is tricky due to the tag that is required to overlay the jqxInput widget properly.. I tried to “cheat” by using a masked input, but I don’t know how to get it to behave like a normal text box (or if it even can do that).

    I’m wondering if there is something I’m doing wrong here.. I realize that this is perhaps unintended usage of this widget, but I don’t see an alternative as I cannot pre-program the html (I don’t know what the controls are until runtime).

    One alternative that I’ve tried, which I don’t really like is to create asp code that dynamically generates the html first, then I overlay the jqxwidgets in a seperate loop afterwards.. This requires two trips to the controller which slows things down a little. What I would really like to do is to take care of all of this in JQuery with one shot. But the tag is tripping me up.

    Anyway, I’ve got this framework laid out already, so this is a frustrating setback. Any suggestions would be greatly appreciated. Hopefully, I’m just missing a closing tag or something silly.

    Thanks,

    Adam


    asuyhayda
    Member

    … soo….

    Please disregard my message. I found my problem. and it was really n00bish.

    the input closing tag was not well formed instead of

    wow.

    Sorry for the bother.


    Peter Stoev
    Keymaster

    Hi Adam,

    In order to use jqxInput, you should add Input tag to your page.

    <input type="text" id="myInput"/>

    Then, you need to select that tag by ID and call the jqxInput constructor function. Each Input should be with unique ID.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.