#109066
Markov
Keymaster

Hi,

The example shows how you can send details to a server and then send back the server result to the Grid via a callback function. The important part of the example is the code below with the synchronization of the Grid with the data model. In your case, here you should make AJAX calls to a server and update the Grid on success.

  virtualDataSource: function (resultCallbackFunction, details) {
                    if (details.action === 'dataBind') {
                        // inits the demo server.
                        window.demoServer = DemoServer();
                        const result = window.demoServer.getData(details);
                        // logs the data below the component.
                        LogData(result.data);
                        resultCallbackFunction({
                            dataSource: result.data,
                            lastId: result.lastId,
                            virtualDataSourceLength: result.length
                        });
                    }
                    else {
                        const result = window.demoServer.getData(details);
                        // logs the data below the component.
                        LogData(result.data);
                        resultCallbackFunction({
                            dataSource: result.data,
                            lastId: result.lastId,
                            virtualDataSourceLength: result.length
                        });
                    }
                },

Best Regards,
Markov

Smart UI Team
https://www.htmlelements.com/