deesoft/yii2-handsontable

Yii2 Handsontable widget

Installs: 246

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Type:yii2-extension

dev-master / 1.x-dev 2016-03-05 15:26 UTC

This package is not auto-updated.

Last update: 2024-03-16 15:42:00 UTC


README

Yii2 Handsontable widget

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require deesoft/yii2-handsontable "~1.0"

or add

"deesoft/yii2-handsontable": "~1.0"

to the require section of your composer.json file.

Usage

<?php
use dee\handsontable\Handsontable;

?>

<?= Handsontable::widget([
    'varName' => 'table1', // <- optional
    'clientOptions' => [
        'data' => $data,
        'column' => [
            ['data' => 'id'],
            ['data' => 'name.first'],
            ['data' => 'name.last'],
            ['data' => 'address']
        ],
        'afterChange' => new JsExpresion('function(){...}'),
    ],
]);?>

<?php $this->registerJs($this->render('_script.js')); ?>

file _script.js

$('mybtn').click(function(){
    tableData = table1.getData();
    // do something with tableData
});