Need Help Setting a Specific Columns Cells to be Editable Only if Undefined.

21 views
Skip to first unread message

josh.fiel...@gmail.com

unread,
Jun 13, 2017, 10:15:46 AM6/13/17
to Handsontable
I want to make a specific columns cells editable only if they have yet to be defined.
Here is what I have so far in cells. Unfortunately it crashes when it tries to run.


<code><pre>
hot_database_table.updateSettings({
cells: function (row, col, prop) {
var cellProperties = {};

if(col === 2) {
try{
console.log(hot_database_table.getData()[row][prop]);
if (hot_".$settings['database']."_".$settings['table'].".getData()[row][prop]===undefined) {cellProperties.readOnly = false;}
else {cellProperties.readOnly = true;}
}
catch(err) {console.log(err);}

return cellProperties;
}
}
});
</pre></code>

I keep getting this error: Cannot read property 'agency_num' of undefined.
(Agency_num is the column name).

Any suggestions on what I should do?

pablo....@ssense.com

unread,
Nov 30, 2017, 4:30:47 PM11/30/17
to Handsontable
I guess not much help around here ?

spilka.krzysztof

unread,
Dec 1, 2017, 3:30:29 AM12/1/17
to Handsontable
Not really, it's only https://github.com/handsontable/handsontable/issues these days.

pablo....@ssense.com

unread,
Dec 7, 2017, 11:41:52 AM12/7/17
to Handsontable
Something along the lines of:

'cellProperties.editor = true;'


should work.

Reply all
Reply to author
Forward
0 new messages