delagoutte Posted August 13, 2019 Share Posted August 13, 2019 Is there any way that unigui grid uses the filtering capabilities of extjs grids like in this extjs sample ? https://examples.sencha.com/extjs/6.7.0/examples/kitchensink/?classic#grid-filtering Link to comment Share on other sites More sharing options...
Sherzod Posted August 13, 2019 Share Posted August 13, 2019 Like this? Link to comment Share on other sites More sharing options...
delagoutte Posted August 13, 2019 Author Share Posted August 13, 2019 yes, exactly for number Link to comment Share on other sites More sharing options...
Sherzod Posted August 13, 2019 Share Posted August 13, 2019 1 hour ago, delagoutte said: Is there any way that unigui grid uses the filtering capabilities of extjs grids like in this extjs sample ? Ok, you can check on this demo example: \FMSoft\Framework\uniGUI\Demos\Desktop\GridEditors 1. UniDBGrid1.ClientEvents.UniEvents function afterCreate(sender) { sender.addPlugin('gridfilters'); } 2. UniDBgrid1.ClientEvents.ExtEvents function beforereconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { columns[0].filter = 'number'; columns[1].filter = { type: 'string', itemDefaults: { emptyText: 'Search for...' } }; columns[2].filter = { type: 'string', itemDefaults: { emptyText: 'Search for...' } }; columns[4].filter = { type: 'date' }; columns[6].filter = { type: 'boolean' }; columns[5].formatter = 'usMoney'; columns[5].filter = 'number'; columns[8].filter = { type: 'list', // options will be used as data to implicitly creates an ArrayStore options: ['New York', 'London', 'Paris', 'Berlin'] }; } 1 Link to comment Share on other sites More sharing options...
Sherzod Posted August 14, 2019 Share Posted August 14, 2019 In runtime, something like this: procedure TMainForm.UniFormReady(Sender: TObject); begin with UniDBGrid1, UniDBGrid1.JSInterface do begin JSConfig('filter', [JSObject('type: "number"')], Columns[0].JSColumn); JSConfig('filter', [JSObject('type: "string", itemDefaults: {emptyText: "Search for..."}')], Columns[1].JSColumn); JSCall('addPlugin', ['gridfilters']); end; end; Link to comment Share on other sites More sharing options...
fcarvalho4 Posted August 14, 2019 Share Posted August 14, 2019 Many thanks! Link to comment Share on other sites More sharing options...
Pier Posted February 27, 2021 Share Posted February 27, 2021 If I use the method suggested by Sherzod, after applying the filter the grid does not update the dataset by issuing scroll events. Am I missing something? Link to comment Share on other sites More sharing options...
Recommended Posts