Editable cells

Info Can edit with double click to text. Save with enter and disable with esc or click out of input.

Method enableEditable

Without parameters

$grid->enableSortable();

Supports

Event onEditCell fired if is cell edited and saved

Info See onEditCellon events page

Usage

$mesourApp = //instance Mesour\Components\Application\IApplication
$source = //some <a href="http://components.mesour.com/version3/component/sources/" target="_blank">data source</a> or two-dimensional array

$grid = new Mesour\UI\DataGrid('filterDataGrid', $mesourApp);

$grid->setSource($source);

//! here enable editable extension
$grid->enableEditable();

//! here use sortable callback
$grid->onEditCell[] = function ($lineId, $columnName, $newValue, $oldValue, $dataValue = NULL) {
    //! do some SQL for save edited column
};

$container = $grid->addContainer('surname', 'Name')
    ->setOrdering(TRUE);

$container->addText('surname', 'Surname');

$container->addText('name', 'Name');

$grid->addText('email', 'E-mail');

$grid->render();

Demo


NameE-mailAmount
Doe John john.doe@test.xx0-
Larson Peter peter.larson@test.xx15,2212014-09-09
Graves Claude claude.graves@test.xx9,8762014-09-02
Norman Stuart stuart.norman@test.xx98,7662014-09-09
Arnold Kathy kathy.arnold@test.xx4572014-09-07
Wilson Jan jan.wilson@test.xx1232014-09-03
Erickson Alberta alberta.erickson@test.xx98,7542014-08-06
Wells Ada ada.wells@test.xx8522014-08-12
Figueroa Ethel ethel.figueroa@test.xx45,6962014-09-05
Goodwin Ian ian.goodwin@test.xx1,2372014-09-04
Hayes Francis francis.hayes@test.xx5,4982014-09-03
Burns Erma erma.burns@test.xx63,2882014-07-02
Jenkins Kristina kristina.jenkins@test.xx74,5242014-08-20
Hunt Virgil virgil.hunt@test.xx65,6552014-08-12
Martin Max max.martin@test.xx541,2372014-09-01
Manning Melody melody.manning@test.xx9,8712014-09-02
Todd Catherine catherine.todd@test.xx1002014-06-11
Stanley Douglas douglas.stanley@test.xx9002014-04-16
Diaz Patti patti.diaz@test.xx1,5002014-09-11
Petterson John john.petterson@test.xx2,5002014-10-10