Page 45 of 92 FirstFirst ... 35434445464755 ... LastLast
Results 441 to 450 of 914

Thread: Grid Filter (Plugin)

  1. #441

    Default

    Hi

    Maybe anybody asked this in the prev. 45 pages ;-) But is there a filter for images?


    Bastian

  2. #442
    Ext User
    Join Date
    Jan 2008
    Location
    Bologna
    Posts
    62

    Default THANK YOU 1000 times .. only one thing and i have finished :)

    Ok,
    writing somthing like:

    {type: 'string', dataIndex: 'name', value:'3',active:false},

    I have a filter disabled and valued with 3... but i don't understand (and i say sorry if there's somewhere but i didn't read it) how can i set comparison operator ?
    There's some API i didn't see..?
    Thank you for your help
    nunzio fiore
    Last edited by nunziofiore; 19 May 2008 at 2:09 AM. Reason: grammar

  3. #443
    Ext User
    Join Date
    Jan 2008
    Location
    Bologna
    Posts
    62

    Default OK I ANSWER MY SELF LIKE COX to JD

    DIANA! READ IT BEFORE TO ASK IT!

    I start reading the long thread and i founded the answer here http://extjs.com/forum/showthread.php?t=14503&page=10
    sorry, next time I read it before!

    to set value to filter elements before rendering table:

    type: 'numeric', dataIndex: 'price',value:{gt:40,lt:80}},
    {type: 'date', dataIndex: 'dateAdded',value:{before:new Date('1/1/1980'),after:new Date('12/1/1979')}},

  4. #444
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    Denver, CO
    Posts
    136

    Default

    nnextjs: Currently there is no support with in the filters to do this directly. However by passing 'pickerOpts' to the DateFilter config you may be able to coax the functionality out with some creative listener work or some other option. This value is passed directly to the Ext.menu.DateMenu objects.

    efiebba: I am unclear as to what an 'image' filter is. So no, I don't think it is supported by default ^.^

  5. #445
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    Denver, CO
    Posts
    136

    Default

    nunziofiore: Cox was once my hero as well, but sadly there is only room enough for House now.

  6. #446

    Default EditorGridPanel Disappearing Data When Filtering

    Hey Ambience, thanks for an awesome plugin. It's exactly what the Dr. ordered for our project, and we use it extensively.

    I have a problem with an EditorGrid.

    I have a button that adds a blank record to my grid, like this:

    Code:
    handler: function(){
                            var r = new Record({
                            	EXP_OBJECTIVE: '',
                            	delete: false
                            });
                            grid.stopEditing();
                            store.insert(0, r);
                            grid.startEditing(0, 0);
                        }
    Works like a charm. The problem occurs when I attempt to filter after I've added a record. Once I've added a record, then attempt to filter, all the records that have been added since the page was loaded simply disappear. They don't come back when I reset the filters, either. It's as if they disappear into thin air.

    I've tried using store.commitChanges(), but this doesn't solve the problem.

    I'm using a local filter with a local store.

    Thanks to anyone for any help.

  7. #447
    Ext User
    Join Date
    Feb 2008
    Posts
    12

    Default

    Is it possible to use Grid Filter with PagingMemoryProxy and local store , under 2.1 ?

    My Grid renders, and has the various filters defined, but there is no
    update to the grid once a filter selection is made.

    Assuming it can be done .... is it possible to filter on all pages at once rather than just
    the one page on screen

    Thanks


    Code:
    	Ext.onReady(function() {
    
    	Ext.menu.RangeMenu.prototype.icons = {
    	  gt: '/ext/img/greater_then.png', 
    	  lt: '/ext/img/less_then.png',
    	  eq: '/ext/img/equals.png'
    	};
    	Ext.grid.filter.StringFilter.prototype.icon = '/ext/img/find.png';
    	Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
    
    
    
    	
    
    	//Ext.namespace("Ext.ux.data");
    
    	Ext.grid.myData = [
    	['<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428192&type=ID&stage=1>428192</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428192&type=FromHost&stage=1>1.1.1.1</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428192&type=DeviceReportedTime&stage=1>2008-05-20 15:43:44</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428192&type=Facility&stage=1>KERN</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428192&type=Priority&stage=1>LOG_INFO</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428192&type=Message&stage=1>imklog 3.19.1, log source = /proc/kmsg started.</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428192&type=SysLogTag&stage=1>kernel:</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=delete&id=428192>Ack</a>']
    ,
    ['<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428193&type=ID&stage=1>428193</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428193&type=FromHost&stage=1>1.1.1.1</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428193&type=DeviceReportedTime&stage=1>2008-05-20 15:43:44</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428193&type=Facility&stage=1>KERN</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428193&type=Priority&stage=1>LOG_INFO</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428193&type=Message&stage=1>Inspecting /boot/System.map</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=edit&id=428193&type=SysLogTag&stage=1>kernel:</a>',
    '<style type=text/css>.x-grid3-cell-inner, .x-grid3-hd-inner { white-space:normal !important; }</style><a href=/prod/syslog.pl?mode=syslog&act=delete&id=428193>Ack</a>']
    
    	];
    	
    	var myReader = new Ext.data.ArrayReader({}, [
    	{name: 'ID'},
    	{name: 'Host'},
    	{name: 'Date_Time'},
    	{name: 'Facility'},
    	{name: 'Priority'},
    	{name: 'Message'},
    	{name: 'Tag'},
    	{name: 'Ack'}
    	]);
    
    	var filters = new Ext.grid.GridFilters({
    	  filters:[
    	    {type: 'numeric',  dataIndex: 'ID'},
    	    {type: 'string',  dataIndex: 'Host'},
    	    {type: 'date',  dataIndex: 'Date_Time'},
    	    {
    	      type: 'list',  
    	      dataIndex: 'Facility', 
    	      options: ['KERN','USER','MAIL','DAEMON','AUTH','SYSLOG','LPR','NEWS','UUCP','CRON','AUTHPRIV','FTP','NTP','LOG_AUDIT','LOG_ALERT','CLOCK','LOCAL0','LOCAL1','LOCAL2','LOCAL3','LOCAL4','LOCAL5','LOCAL6','LOCAL7'],
    	    },
                {
                  type: 'list',
                  dataIndex: 'Priority',
                  options: ['EMERG','ALERT','CRIT','ERR','WARNING','NOTICE','INFO','DEBUG'],
                },
    	    {type: 'string',  dataIndex: 'Message'},
    	    {type: 'string',  dataIndex: 'Tag'},
    	    {type: 'boolean', dataIndex: 'Ack'}
    	]});
    
    	
    
    	var dstore = new Ext.data.Store({
                            proxy: new Ext.data.PagingMemoryProxy(Ext.grid.myData),
                            reader: myReader,
    			remoteSort: true,
    			autoLoad: {params: {start: 0, limit: 9}}
                    });
    
    	
    
    	var grid = new Ext.grid.GridPanel({
    	  store: dstore, 
    	
    		cm: new Ext.grid.ColumnModel([
    		{header: 'ID', width: 20, sortable: true, locked:true, dataIndex: 'ID'},
    	{header: 'Host', width: 100, sortable: true, locked:true, dataIndex: 'Host'},
    	{header: 'Date_Time', width: 120, sortable: true, locked:true, dataIndex: 'Date_Time'},
    	{header: 'Facility', width: 100, sortable: true, locked:true, dataIndex: 'Facility'},
    	{header: 'Priority', width: 100, sortable: true, locked:true, dataIndex: 'Priority'},
    	{header: 'Message', width: 200, sortable: true, locked:true, dataIndex: 'Message'},
    	{header: 'Tag', width: 80, sortable: true, locked:true, dataIndex: 'Tag'},
    	{header: 'Ack', width: 60, css: '{white-space:normal;}', sortable: false, dataIndex: 'Ack'}
    	]),
    		viewConfig: {
    			forceFit:  true, 
    			autoFill : true
    		},
    		title: 'Grid syslog Management',
    		autoFit: true,
    		autoExpandColumn: 'Host',
    		autoHeight: true,
    		frame: true,
    		enableColLock: false,
    		loadMask: true,
    		plugins: filters,
    		id: 'grid',
    		renderTo: 'dgrid',
    		bbar: new Ext.PagingToolbar({
    			pageSize: 9,
    			store: dstore,
    			plugins: filters,
    			displayInfo: true  
    			})
    	});
     
    	grid.getSelectionModel().selectFirstRow();
    
    	grid.render();
    
            // trigger the data store load
    	//dstore.load({params:{start:0, limit:15}});
    
    
    });

  8. #448

    Thumbs up Congratulations... and sample (simple) java code...

    Congratulations, nice work...

    I've used on my application, it was really easy to integrate with my existing Grid... and really powerfull...

    only one question: it's possible to clear all filters by code? how?

    Thanks,

    Here is my java code (I'm using it to query via XPath, not SQL):
    PHP Code:
    logger.debug("--> Filers");
    String queryString "";
    for (
    int i 0truei++) {
        
    String field request.getParameter("filter[" "][field]");
        if (
    field == null) {
            
    queryString += queryString.length() > "]" "";
            break;
        }
        
    queryString += queryString.length() == "[" " and ";
        
    String comparison request.getParameter("filter[" "][data][comparison]");
        if (
    comparison != null) {
            if (
    comparison.equals("lt")) {
                
    comparison "<";
            } else if (
    comparison.equals("gt")) {
                
    comparison ">";
            } else if (
    comparison.equals("eq")) {
                
    comparison "=";
            }
        }
        
    String type request.getParameter("filter[" "][data][type]");
        
    String value request.getParameter("filter[" "][data][value]");

        if (
    logger.isDebugEnabled()) {
            
    logger.debug("Filter found: " field);
            
    logger.debug("--- field: " field);
            
    logger.debug("--- comparison: " comparison);
            
    logger.debug("--- value: " value);
        }

        if (
    type.equals("string")) {
            
    queryString += "ucase(@" field ") like \"%" value.toUpperCase() + "%\"";
        } else if (
    type.equals("date")) {
            
    queryString += "@" field " " comparison " \"" value "\"";
        } else if (
    type.equals("numeric")) {
            
    queryString += "@" field " " comparison " " value "";
        }
    }
    query += queryString;
    logger.debug("End of Filers >--"); 

  9. #449

    Default

    Quote Originally Posted by technicaltitch View Post
    dterle - set your options array to the same array you set your SimpleStore dataArray to, ie
    Code:
    options: [['0', 'Mlle'],['1', 'Mme'],['2', 'M.']],
    (or better still have one named array variable that both point to).
    Hi, I got the same question as dterle
    the filter store config looks like don't work with SimpleStore object, but data.Store.
    and sometime you just need the same SimpleStore a lot
    you don't want to use options: [....] everywhere

    is there any way to use SimpleStore for options?
    something we don't have to convert by ourself

    for example, in my case, i just convert by myself:
    Code:
    function dsToArray(ds) {
    	var foobar = new Array();
    	for (var i=0; i < ds.data.length; i++) {
    		foobar[i] = ds.data.items[i].json;
    	};
    	return foobar;
    }
    
    var dsYesNo = new Ext.data.SimpleStore({
    	fields: ['value', 'name'],
    	data: [[0, 'No'], [1, 'Yes']]
    });
    
    var filters = new Ext.ux.grid.GridFilters({
    	filters: [
    		{type: 'list', dataIndex: 'active', options: dsToArray(dsYesNo)}
    	]
    });

  10. #450

    Default

    Thanks for sharing your plugin Abience. Very usefull.
    I was wondering if anyone tried to mark filtered column in the header with image icon instead of font. I tried to change style for the filter but changing background-image will break default background for the header.
    After digging deeper into source code I see that its possible to change header cell template and overwriting GridView.prototype.renderHeaders but then it would be hacking.

    Anyone solved this or have better idea?

    Thanks.

Page 45 of 92 FirstFirst ... 35434445464755 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •