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