Hybrid View
-
20 Sep 2006 9:39 AM #1
Can a column display a graphic?
Can a column display a graphic?
Is it possible for acolumn to display a graphic? Either static, or based on the value in the cell?
-
20 Sep 2006 12:37 PM #2
Yes, using a renderer function.
Note: If you need to display big images you will have to customize the row/cell heights defined in the CSS.Code:function renderImage(value, rowIndex, colIndex){ return '[img]myimage.gif[/img]'; } // then in your column model definition: var myColumns = [ {header: "Icon", width: 20, renderer: renderImage}, ... ];
-
21 Sep 2006 11:28 PM #3
Re: Can a column display a graphic?
Re: Can a column display a graphic?
Can somebody explain the second part of the question "based on the value in the cell". How do i update only one row's image cell based on the value in other (assuming that the value is editable)?
Originally Posted by donalconlon
-
22 Sep 2006 12:41 AM #4
You will need a reference to your DataModel to get the other cell's value.
Code:// create your data model var dataModel = {...} function renderImage(value, rowIndex, colIndex){ if(value == 'foo'){ return '[img]foo.gif[/img]'; }else{ // get the value at row 1, column 1 var otherValue = dataModel.getValueAt(1, 1); if(otherValue == 'bar'){ return '[img]bar.gif[/img]'; }else{ return '[img]none.gif[/img]'; } } }
-
22 Sep 2006 4:53 AM #5
i tried this out, it works great..
Originally Posted by jacksloc
But when i tried doing
var otherValue = dataModel.getValueAt(rowIndex, 1);
it flags an error as to
this.data[rowIndex] is not a valid property ( for yui-ext.js file)
-
22 Sep 2006 10:59 AM #6
The rowIndex, colIndex parameters appear to be additions in the new version. I thought they were present in the old version but they are not.
The version will be out on Monday and has these parameters.
Similar Threads
-
IE display problems
By wilzmodz in forum Ext 1.x: Help & DiscussionReplies: 4Last Post: 31 Mar 2007, 8:54 AM -
YAHOO.ext.Element Display
By ojintoad in forum Ext 1.x: Help & DiscussionReplies: 6Last Post: 1 Jan 2007, 2:20 AM -
Can i display a tab again after close it?
By kirk in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 4 Dec 2006, 3:48 PM -
Cannot display 0 in grid
By alcarx in forum Ext 1.x: BugsReplies: 1Last Post: 16 Oct 2006, 2:54 AM


Reply With Quote