Forum /
Ext JS 2.x - Unsupported /
Ext 2.x: Help & Discussion /
Grid checkbox and number field
Grid checkbox and number field
Hi.
I have a grid that display some invoices.
I want to add a check box in each row and a number field - disabled by default.
When you'll check the checkbox - the number filed will became enabled so the user can enter the amount.
That's the ideea.
But it seams that I can't manage to add the checkbox in Ext 2.3.0 to rows.
My code is something like this:
mainClientiFacturiHeader = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),
{header: "IDFACTURA", width: 0, dataIndex: 'IDFACTURA', hidden: true},
{header: "IDCLIENT", width: 0, dataIndex: 'IDFACTURARE', hidden: true},
{header: "Numar", width: 70, dataIndex: 'FNUMAR', sortable: true, hidden: false},
{header: "Tip", width: 30, dataIndex: 'FTYPE', sortable: true, hidden: false},
{header: "Data", width: 35, dataIndex: 'FDATA', sortable: true, hidden: false},
{header: "Scadenta", width: 35, dataIndex: 'FDATASCADENTA', sortable: true, hidden: false},
{header: "Valoare", width: 45, dataIndex: 'FVALOARE', sortable: true, hidden: false, align: 'right'},
{header: "Rest Incasare", width: 45, dataIndex: 'FSOLD', sortable: true, hidden: false, align: 'right'},
{header: "Incaseaza", width: 40, dataIndex: 'FINCASAREFLAG', hidden: false, align: 'center', editor: new Ext.form.Checkbox() },
{header: "Suma", width: 60, dataIndex: 'FINCASARESUMA', hidden: false, align: 'right', editor: new Ext.form.TextField() }
]);
mainClientiFacturiHeaderFilters = new Ext.grid.GridFilters({
local: true, paramPrefix: 'plugin_filters', filtersText: 'Filtre',
filters:[ {type: 'string', dataIndex: 'NRDOC'} ] });
mainClientiFacturi = new Ext.grid.EditorGridPanel({
title: mainClientiFacturiTitle,
frame: true, border: true,
store: store_mainClientiFacturi,
cm: mainClientiFacturiHeader,
sm: new Ext.grid.RowSelectionModel({
singleSelect: true,
listeners: { rowselect: function(sm, row, rec)
{
}, delay: 2 }}),
clicksToEdit: 0,
disabled: (cl_is_repartizareauto == '1' ? true : false),
height: ( panelHeight - (Ext.isIE ? 206 : 206) ) ,
plugins: mainClientiFacturiHeaderFilters
});
I want to make it as simple as possible.
Thank you
Sencha - Community Support Team
You can use a CheckColumn (copy from examples/edit-grid.js to a separate file).
thanks
thanks
I try that. But it seams that if the grid is disabled by default the checkbox don't work so well - meaning I can click on the checkbox.
And I preffer a very simple solution without the checkcolumn.
thanks
Sencha - Community Support Team
What do you mean by 'disabled by default'? You can't disable a grid; you can only mask it.
Hi.
yes - it's masked.
So - is there any solution to my problem.
Thank you so much for your help.
Sencha - Community Support Team
You can't click the checkbox when the grid is masked, so I still don't understand the problem.
Similar Threads
By naleen in forum Ext 3.x: Help & Discussion
Replies: 6
Last Post: 10 Apr 2010, 7:53 AM
By dleblanc in forum Ext GWT: Bugs (1.x)
Replies: 2
Last Post: 1 Apr 2009, 4:18 AM
By ripanpradhan in forum Ext 2.x: Help & Discussion
Replies: 0
Last Post: 17 Mar 2008, 4:37 AM
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us