Jump to content

grow filter capacity for grid


delagoutte

Recommended Posts

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']
    };
}

 

  • Like 1
Link to comment
Share on other sites

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

  • 1 year later...
×
×
  • Create New...