Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to define default options #11

Closed
fanturi opened this issue Mar 26, 2015 · 4 comments
Closed

How to define default options #11

fanturi opened this issue Mar 26, 2015 · 4 comments

Comments

@fanturi
Copy link

fanturi commented Mar 26, 2015

Hi,

I would like to define defaults option for all jsgrid I'm using on my website.
How can I do that ? Is it possible without change the options in jsgrid.js directly ?

Thanks for your work.

@tabalinas
Copy link
Owner

Hi,

Yes, you can do it with following code

$.extend(jsGrid.Grid.prototype, {
     // default options here
});

Gonna add special method for this.
Thank you for request.

@fanturi
Copy link
Author

fanturi commented Mar 26, 2015

it's great.
is it possible to define default option for control column type too ?
since you have labels in options it's a good idea to allow a special method to define this option for translation for example.

thanks.

@tabalinas
Copy link
Owner

Yes, it's possible for fields in the similar way

$.extend(jsGrid.fields.checkbox.prototype, {
     // default options here
});

You can define options of any other build-in field, just specify its name instead of checkbox (text, textarea, number, select or control).
I completely agree with you, this should be considered to make localization easier.

@buttflattery
Copy link

hi can you give any reference to the document where this is listed @tabalinas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants