PDA

View Full Version : CheckColumn Checked



Maia
Jan 12, 2010, 5:27 PM
Hi,
I would like know what's the function to know if the CheckColumn is checked or no?



<ext:CheckColumn ColumnID="mnuPermissao" Header="Permissão" Align="Center" Sortable="true" DataIndex="mnuPermissao" Width="70" Editable="true">
<Renderer Handler="if(checked){#{GridPanel1}.disable();}" />
</ext:CheckColumn>


Maia
Coolite 0.8.1

Maia
Jan 13, 2010, 9:05 AM
Hy!
I tried with function below:



<Renderer Handler="if(checked){#{GridPanel1}.disable();}" />


but error occurred



checked is not defined


Any tip?
Maia
Coolite 0.8.1

geoffrey.mcgill
Jan 13, 2010, 12:40 PM
Hi Maia,

You can use 'value' instead of 'checked'.

A simple way of determining the parameter names is to inspect the configuration script. You should find something similar to the following.

Example


renderer : function (value, metadata, record, rowIndex, colIndex, store) { /* YOUR LOGIC HERE */ }

The first parameter is the field value.

More information regarding the renderer is also available at the following location, see

http://www.extjs.com/deploy/dev/docs/?class=Ext.grid.Column&amp;member=renderer

Maia
Jan 13, 2010, 2:11 PM
Hi Geoffrey!
I tried your tip, but when I put the Script with Renderer Checkbox disappeared from the grid. See the attachment.



<script type="text/javascript">
var checkPermissao = function(value, metadata, record, rowIndex, colIndex, store) {
alert(record.data.mnuDescricao);

};
</script>

<ext:CheckColumn ColumnID="mnuPermissao" Header="Permissão" Align="Center" Sortable="true" DataIndex="mnuPermissao" Width="70" Editable="true">
<Renderer fn="checkPermissao" />
</ext:CheckColumn>

Tks.
Maia
Coolite 0.8.1

geoffrey.mcgill
Jan 13, 2010, 3:13 PM
Hi Maia,

The Renderer must return the html required to render the contents of that particular cell. You can confirm by returning the value.


Example



return value.toString();


Please note as well, the renderer will fire once for each record. If you're calling alert(), the alert will render once for each record being renderer in your GridPanel.


Hope this helps.

Maia
Jan 14, 2010, 9:04 AM
Hi Geoffrey,

para verificar se o checbox está assinalado.">In the Checbox have the function <Check handler> to verify that the checbox is marked or not.
With CheckColumn is it possible?

Tks Maia.
Coolite 0.8.2

Vladimir
Jan 14, 2010, 9:19 AM
Hi,

You have to read check column value from the store. Do not use renderer for it. For example, for first row

Store1.getAt(0).get('mnuPermissao')

Vladimir
Jan 14, 2010, 9:30 AM
Hi,

Also the following posts can be useful for you
http://forums.ext.net/showthread.php?postid=17598.aspx
http://forums.ext.net/showthread.php?postid=18375.aspx