jQuery UI Widgets Forums React Update Source in React

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  admin 1 month, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Update Source in React #135264

    Hanwik
    Participant

    Hi There,
    can change source of widget (grid,dropdown,…) without using useState Hook,
    which annoyed within a code block.
    Using useRef-variable.current, document.getElementById or pure javascript?

    Ex: gridRef.current.refreshdata();
    gridRef.current.renderWidget();
    within CRUD to show updated data that would re-requested from some api

    Note: I use Functional method instade of Class.

    Apriciated if supported by simple example
    Regards;

    • This topic was modified 1 month, 1 week ago by  Hanwik.
    • This topic was modified 1 month, 1 week ago by  Hanwik.
    • This topic was modified 1 month, 1 week ago by  Hanwik.
    Update Source in React #135284

    admin
    Keymaster

    Hi Hanwik,

    If you would like to update the source of the dropdown inside a column, you can use the column’s createeditor callback function. Inside it, you have access to the Dropdownlist editor and you can update its source to a different array of items.

    Example:

     {
                    text: 'Category', dataField: 'category', width: 250, 
                    columntype: 'dropdownlist',
                    createeditor: function (row, cellvalue, editor) {
                        // Set initial source for the jqxDropDownList editor
                        editor.jqxDropDownList({ source: ["A", "B", "C", "D"]});
                    }
                }

    Best regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.