Inline editing not disabled correctly with two grids on a page

QuestionsInline editing not disabled correctly with two grids on a page
Bo Knuth asked 10 years ago

I use the JS function below to set select rows to readonly. The Action column is set correctly. And inline editing is indeed disabled as it should be when only one grid is on the page. However, when I add a second grid, inline editing is enabled on rows where it should not be.

function grid6_load()
{
var grid = $('#list6');
var rowids = grid.getDataIDs();
var columnModels = grid.getGridParam().colModel;

// check each visible row
for (var i = 0; i < rowids.length; i++)
{
var rowid = rowids[i];
var data = grid.getRowData(rowid);

if (data.account == 'read_only') // view only
{
jQuery("tr#"+rowid).addClass("not-editable-row");
jQuery("tr#"+rowid+" td[aria-describedby$='_act']").html("-");
}
}

}

2 Answers
Abu Ghufran answered 10 years ago

If i understand issue correctly, you need to prefix tr#id selector with #grid_id to uniquely identify grid.

e.g.

jQuery("#list6 tr#"+rowid+" td[aria-describedby$='_act']").html("-");

Bo Knuth answered 10 years ago

That did the trick. Thank you sir.

Your Answer

4 + 14 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?