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

There is a method to put a readOnly input ? #28

Closed
buroli opened this issue Jun 22, 2012 · 5 comments
Closed

There is a method to put a readOnly input ? #28

buroli opened this issue Jun 22, 2012 · 5 comments

Comments

@buroli
Copy link

buroli commented Jun 22, 2012

Hello,

You think is possible to create a method to put a readOnly input ?

For example, I have to put a readOnly input when I click of a checkbox.

Thanks.

@warpech
Copy link
Member

warpech commented Jun 25, 2012

Hi, actually it is possible with the Legend feature:

legend: {
  match: function (row, col, data) {
    return (col === 0); //if it is first col
  },
  readOnly: true //make it read-only
}

Does this solve your problem? Do you think I could describe it better in the README/example page?

@buroli
Copy link
Author

buroli commented Jun 26, 2012

Hi,

Yes, I made a screenshot : http://i46.tinypic.com/idapn9.png

When you click of a checkbox, the cell on his right become readOnly.

Possible ?

Thanks.

@warpech
Copy link
Member

warpech commented Jun 27, 2012

This is totally possible. Could you set up this grid on JSFiddle? I will show you how to configure legend then

@buroli
Copy link
Author

buroli commented Jun 27, 2012

Yes of course.

Here are: http://jsfiddle.net/rxxQ9/6/

Thanks.

@warpech
Copy link
Member

warpech commented Jun 27, 2012

Unfortunately I was wrong, it is not possible with the legend.

I created a custom jQuery code to do that: http://jsfiddle.net/jXdyA/

Also please note that you used allowHtml param incorrectly. In my fiddle I fixed this:

$("#example2grid").handsontable("loadData", data, [allowHtml = true]);

To this:

$("#example2grid").handsontable("loadData", data, true);

The fragment [allowHtml = true] in README is a JSDoc convention to show default value for a parameter (see http://code.google.com/p/jsdoc-toolkit/wiki/TagParam)

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