jQWidgets Forums

jQuery UI Widgets Forums React jqxComboBox & jqxToolBar

This topic contains 1 reply, has 2 voices, and was last updated by  Ivo Zhulev 7 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • jqxComboBox & jqxToolBar #94853

    AsterionDB
    Participant

    I have a jqxComboBox that is populated with JSON data using a jqxDataAdapter and an external source. I have noticed that when the jqxComboBox is part of a jqxToolBar, the data-adapter gets called 4 times – thus hitting my external source for the same data 4 consecutive times.

    When the jqxComboBox is not part of a jqxToolBar, the data-adapter gets called once, as would be expected.

    Is there a reason why the data-adapter is getting called 4 times?

    Here’s my test-case. Thanks…>>>

    import React from 'react'
    
    import JqxToolBar from '../../components/jqwidgets-react/react_jqxtoolbar.js'
    
    class TestCase extends React.Component
    {
      comboBoxClosed(event)
      {
        console.log('combo box closed');
      }
    
      render() 
      {
        let fileTypeDS =
        {
          datatype: 'json',
          datafields: 
          [
              { name: 'FILE_TYPE', type: 'string' }
          ],
          id: 'FILE_TYPE',
          url: window.asterionRestAPI + '/getFileTypes'
        };
    
        let fileTypeDA = new window.$.jqx.dataAdapter(fileTypeDS);
        
        let tools = 'combobox';
        let initTools = (type, index, tool, menuToolIninitialization) => 
        { 
          switch (index)
          {
            case 0:  
              tool.jqxComboBox(
              { 
                width: 150, 
                source: fileTypeDA, 
                checkboxes: true, 
                displayMember: 'FILE_TYPE', 
                valueMember: 'FILE_TYPE'
              }).on('close', this.comboBoxClosed);
              break;
    
            default:
              break;
          }
          return { minimizable: false };
        }
        
        return (<JqxToolBar width={800} height={35} initTools={initTools} tools={tools}/>);
      }
    }
    
    export default TestCase
    jqxComboBox & jqxToolBar #94893

    Ivo Zhulev
    Participant

    Hi AsterionDB,

    A work item has been created. For now, place some flag to reduce the calls to one.
    Sorry for the inconvenience.

    Regards,
    Ivo

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

You must be logged in to reply to this topic.