I need to access a sibling object within and object.
I have tried the following but it does not work
var obj = {
settings: {
container: $('#agrid')
},
columns: settings.container.data('columns'),
rows: settings.container.data('rows'),
}
I have also tried
var obj = {
settings: {
container: $('#agrid')
},
columns: this.settings.container.data('columns'),
rows: this.settings.container.data('rows'),
}
But it does not work either.
UPDATE
I currently do it this way, but since the columns and row, values does not change I would like to be a static value istead of a function.
var s,
aGrid = {
settings: {
container: $('#agrid')
},
init: function () {
s = this.settings;
},
getColumns: function () {
return s.container.data('agrid-columns');
},
getRows: function () {
return s.container.data('agrid-rows');
},
};
aGrid.init();
The html is just the following.
<div id="agrid" data-agrid-rows="3" data-agrid-columns="6">
</div>