tabalinas / jsgrid-php

Sample project for jsgrid with PHP REST-service
MIT License
91 stars 48 forks source link

Predefined Values #6

Closed dipiana closed 8 years ago

dipiana commented 8 years ago

Is it possible to set predefined values for fields? For example I would like to to have certain checkboxes check by default, as soon as I create a new DB-Entry.

Thanks a lot!

tabalinas commented 8 years ago

What's about setting default values in controller.insertItem before sending data to the server? Or if you wish to set default value in the inserting control then you can do something like (example for text field):

insertTemplate: function() {
    var $insertControl = jsGrid.fields.text.prototype.insertTemplate.call(this);
    return $insertControl.val("my-default-value");
}