jQWidgets Forums

jQuery UI Widgets Forums Form Is there a way to set other properties of component in template

This topic contains 2 replies, has 3 voices, and was last updated by  Fabrice 6 years, 2 months ago.

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

  • Admir Hodžić
    Participant

    Sory if this is documented.
    Bud API documentation for template on your site does not works.
    It just freaze page when you click on TEMPLATE label
    https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxform/jquery-form-api.htm?search=
    same thing haening if you try to read TEMPLATE api from demo page.

    I am wondering is there a way to set properites for componet inside temlate

    Something like this:

    var template = [
            {
                bind: 'faktorPakovanja',
                type: 'number',
                label: 'Faktor pakovanja',
                required: true,
                labelWidth: '80px',
                width: '250px',
                info: 'Faktor pakovanja',
                infoPosition: 'right',
                component: 'jqxNumberInput',
                options: [
                    { symbol: 'KM' },
                    { min : 0 }
    
                ]
            }]

    Two questions :
    What types of component we can use in templates ?
    Can and how we set properties of components we putting in template.


    admin
    Keymaster

    Hi Admir.

    Thank you for contacting us. We’re still working on improving the documentation. We will add a few more examples with more advanced customization of the components inside the form. In general, you can have any component and initialize it in the following way:

                   {
                        bind: 'nubmberBoxValue',
                        type: 'number',
                        label: 'Number input',
                        labelPosition: 'left',
                        labelWidth: '80px',
                        align: 'left',
                        width: '250px',
                        required: true,
                        init: function(component)
                        {
                            component.jqxNumberInput({ symbol: 'KM', min: 0, width: '250px' });
                        }
                    }

    You can use any jQWidgets component. You will have to pass all required parameters including those for width and height (if needed).

    Best Regards,
    Peter Stoev

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


    Fabrice
    Participant

    Hi,

    The usage of “init” function is Ok with jqxNumberInput, but shows this message when I use the jqxInput type
    <<<Error: jqxInput: Missing Text Input in the Input Group>>>

    init: function(component)
                {
    //                component.jqxNumberInput({ symbol: 'KM', min: 0, width: '250px' });
    
                    component.jqxInput({
                        placeHolder: "Enter a Country",
                        height: 25,
                        width: 200,
                        minLength: 1,
                    });
    
                }

    Why this component raise a error ?
    Thx for your help

    Fabrice

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

You must be logged in to reply to this topic.