Disabling rows in a matrix | XM Community
Solved

Disabling rows in a matrix

  • 11 April 2024
  • 2 replies
  • 28 views

Badge +1

I want to disable selected rows in a matrix.

@TomG helped me out on something similar. 

However I want to rewrite the code to disable selected rows (say row 1 & 2) in column 1

jQuery(".c4 input[type='text']").prop("disabled",true); 

 

icon

Best answer by TomG 11 April 2024, 18:40

View original

2 replies

Userlevel 7
Badge +27

@mugheeshay,

If the rows aren’t randomized, you can do it by position:

var column1 = jQuery(".c4 input[type='text']");
var disableRows = [1, 2];
jQuery.each(disableRows, function(i,row) {
column1.eq(row-1).prop("disabled",true);
});

 

Badge +1

@mugheeshay,

If the rows aren’t randomized, you can do it by position:

var column1 = jQuery(".c4 input[type='text']");
var disableRows = [1, 2];
jQuery.each(disableRows, function(i,row) {
column1.eq(row-1).prop("disabled",true);
});

 

Legend

Leave a Reply