You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Hugo Ferreira <hf...@gmail.com> on 2021/11/14 12:00:51 UTC

Access DataGridColumn from DataGridItemRenderer

Hi,

I already have my DataGrid completely editable with all the features (Enter
and Tab keys).
I want now to implement the editable property on the DataGridColumn, so I
could choose each column to be editable.
However I need to access this property inside DataGridColumn from the
DataGridItemRenderer perspective.

I couldn't find a way to navigate to DataGridColumn thru
DataGridItemRenderer.

Any thoughts?

Re: Access DataGridColumn from DataGridItemRenderer

Posted by Hugo Ferreira <hf...@gmail.com>.
I found it :)

Inside ItemRenderer:

var columnList:DataGridColumnList = this.parent as DataGridColumnList;
var column:IDataGridColumn = columnList.columnInfo;
var editable:Boolean = (column as DataGridColumn).editable;

Tested with an editable and non editable column.

The first line navigates to the list of columns (each column is a list).
The second line navigates to the column instance (DataGridColumn).

Hugo Ferreira <hf...@gmail.com> escreveu no dia domingo, 14/11/2021
à(s) 12:03:

> By the way, this is the way I instantiate the ItemRenderer:
>
> package pt.solidsoft.framework.components.datagrid.textgridcolumn
> {
> import pt.solidsoft.framework.components.datagrid.DataGridColumn;
> import org.apache.royale.core.ClassFactory;
> import
> pt.solidsoft.framework.components.datagrid.textgridcolumn.TextGridItemRenderer;
>
> public class TextGridColumn extends DataGridColumn
> {
> public function TextGridColumn()
> {
> itemRenderer = new ClassFactory(TextGridItemRenderer);
> }
> }
> }
>
> Hugo Ferreira <hf...@gmail.com> escreveu no dia domingo,
> 14/11/2021 à(s) 12:00:
>
>> Hi,
>>
>> I already have my DataGrid completely editable with all the features
>> (Enter and Tab keys).
>> I want now to implement the editable property on the DataGridColumn, so I
>> could choose each column to be editable.
>> However I need to access this property inside DataGridColumn from the
>> DataGridItemRenderer perspective.
>>
>> I couldn't find a way to navigate to DataGridColumn thru
>> DataGridItemRenderer.
>>
>> Any thoughts?
>>
>

Re: Access DataGridColumn from DataGridItemRenderer

Posted by Hugo Ferreira <hf...@gmail.com>.
By the way, this is the way I instantiate the ItemRenderer:

package pt.solidsoft.framework.components.datagrid.textgridcolumn
{
import pt.solidsoft.framework.components.datagrid.DataGridColumn;
import org.apache.royale.core.ClassFactory;
import
pt.solidsoft.framework.components.datagrid.textgridcolumn.TextGridItemRenderer;

public class TextGridColumn extends DataGridColumn
{
public function TextGridColumn()
{
itemRenderer = new ClassFactory(TextGridItemRenderer);
}
}
}

Hugo Ferreira <hf...@gmail.com> escreveu no dia domingo, 14/11/2021
à(s) 12:00:

> Hi,
>
> I already have my DataGrid completely editable with all the features
> (Enter and Tab keys).
> I want now to implement the editable property on the DataGridColumn, so I
> could choose each column to be editable.
> However I need to access this property inside DataGridColumn from the
> DataGridItemRenderer perspective.
>
> I couldn't find a way to navigate to DataGridColumn thru
> DataGridItemRenderer.
>
> Any thoughts?
>