1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    64
    Answers
    2
    Vote Rating
    0
    punith.mailme is on a distinguished road

      0  

    Default Answered: mark invalid for grid apnel.

    Answered: mark invalid for grid apnel.


    Hi Guys,

    I have a grid panel and want to mark it as invalid if there is less then 0 record.
    I need some thing like the form.fields markInvalid() method which will make the border appear red. So i want to make the grid panel border to become red.

    How can i achieve the same for a grid panel. ??

    Thanks
    Punith

  2. You do something like this:

    Code:
    // test button to mark the grid as error
    text: 'red alert!',
    handler: function() {
    	grid.body.applyStyles({
    		'border-color': '#ff0000'
    	});
    }
    Code:
    // add listener to grid to display a tooltip if there are no records
    listeners: {
    	afterrender: function(grid) {
    		if (grid.store.totalCount === 0) {
    			var view = grid.getView();
    
    			view.tip = Ext.create('Ext.tip.ToolTip', {
    				// The overall target element.
    				target: view.el,
    				// Each grid row causes its own seperate show and hide.
    				delegate: view.itemSelector,
    				// Moving within the row should not hide the tip.
    				trackMouse: true,
    				// Render immediately so that tip.body can be referenced prior to the first show.
    				renderTo: Ext.getBody(),
    				listeners: {
    					// Change content dynamically depending on which element triggered the show.
    					beforeshow: function updateTipBody(tip) {
    						tip.update('There are no records in your grid, go find some!');
    					}
    				}
    			});
    		}
    	}
    }
    You will need to make adjustments as needed.

    Regards,
    Scott.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Answers
    656
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Have a look at:

    .x-panel .x-grid-body {
    border-color
    }

    Regards,
    Scott.

  4. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    64
    Answers
    2
    Vote Rating
    0
    punith.mailme is on a distinguished road

      0  

    Default


    HI scott thanks,

    But how can i add a error message for this, as it works for markinvalid() ??
    as the user hovers on the grid component i want to show the error message

  5. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Answers
    656
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    You do something like this:

    Code:
    // test button to mark the grid as error
    text: 'red alert!',
    handler: function() {
    	grid.body.applyStyles({
    		'border-color': '#ff0000'
    	});
    }
    Code:
    // add listener to grid to display a tooltip if there are no records
    listeners: {
    	afterrender: function(grid) {
    		if (grid.store.totalCount === 0) {
    			var view = grid.getView();
    
    			view.tip = Ext.create('Ext.tip.ToolTip', {
    				// The overall target element.
    				target: view.el,
    				// Each grid row causes its own seperate show and hide.
    				delegate: view.itemSelector,
    				// Moving within the row should not hide the tip.
    				trackMouse: true,
    				// Render immediately so that tip.body can be referenced prior to the first show.
    				renderTo: Ext.getBody(),
    				listeners: {
    					// Change content dynamically depending on which element triggered the show.
    					beforeshow: function updateTipBody(tip) {
    						tip.update('There are no records in your grid, go find some!');
    					}
    				}
    			});
    		}
    	}
    }
    You will need to make adjustments as needed.

    Regards,
    Scott.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi