0

Firebug Screenshot showing an object tree.

The screenshot of Firebug above shows the DOM objects from a site I have loaded. Actually I am using a library (EditableGrid) to allow me editing a table called 'itemlist'.

I want to set the columns property editable to false "on the fly" with JavaScript. In the header bar of Firebug I see Window > databgrid > editableGrid > columns > 3.

Can anybody point me to the correct way on accessing and modifing the "editable" object attribute of column 3.

I tried in various combinations of

var tbl = document.getElementById('itemlist');

var col = document.getElementClassName('window.datagrid.editableGrid.columns');
col.value = "true";

but I couldn't access the property.

2 Answers 2

1

document.getElementById() and document.getElementClassName() select HTML elements. You want to access a DOM object. Looking at the path shown within Firebug's DOM panel it should be accessible directly via datagrid.editableGrid.columns[3].

Sign up to request clarification or add additional context in comments.

2 Comments

when I enter the statement in the console window: var eg3 = document.getElementsByName('datagrid.editableGrid.columns[3]') I get a reply undefined. That is still my problem.
Don't use document.getElementsByName() or suchlike, just enter datagrid.editableGrid.columns[3] directly.
0

Sebastian was perfectly right. There is no need to retrieve the element via the DOM functions.

value = datagrid.editableGrid.columns[3];

Just retrieves the datastructure variable. I wasn't aware that black/bold colored objects could be set and get directly.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.