jQuery UI Widgets › Forums › General Discussions › React › Update Source in React

Tagged: 

This topic contains 2 replies, has 3 voices, and was last updated by  thelifesmag 5 months, 3 weeks ago.

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

    Hanwik
    Member

    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 2 years, 1 month ago by  Hanwik.
    • This topic was modified 2 years, 1 month ago by  Hanwik.
    • This topic was modified 2 years, 1 month 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/

    Update Source in React #136600

    thelifesmag
    Participant

    The Lifesciences Magazine is a global healthcare solutions platform that paves the way for various healthcare innovations, expert advice, and the success stories of professionals in the field who are driving transformation with their innovative thinking.

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

You must be logged in to reply to this topic.