Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By lalinda74
#825053
I have a checkbox column in my grid view. Initially checkbox column is disabled. I need to enable a checkbox in specific row. How to do this ?

Please find the below code as well.
Code: Select all
for (int i=0; i<=count; i++){
    var siteCount = $("#saq_gridVendorData").getValue(i, 6);
    if (siteCount == 1){
	//If site count is 1 the checkbox in that specific row should be enabled.
    }
}
#825150
I have two checkbox columns in my grid view. I need to disable only the 'Other Sites Payments' column. Currently I'm disabling when the row doesn't have any checked check-boxes. Do you know a solution for this ?
Code: Select all
var numRows = $("#saq_gridVendorData").getNumberRows();
var aRows = $("#saq_gridVendorData").find("div.pmdynaform-grid-row");

for (i = 1; i <= numRows; i++) { 
    var otherSitesCheck = $("#saq_gridVendorData").getValue(i,4);
    var blockVendorCheck = $("#saq_gridVendorData").getValue(i,5);
  	$(aRows[i-1]).find("input[type=checkbox]").attr("disabled", true);
    if (otherSitesCheck == '0'){
      $(aRows[i-1]).find("input[type=checkbox]").attr("disabled", true);
    }
  	else{
      $(aRows[i-1]).find("input[type=checkbox]").attr("disabled", false);
    }
}
Additionally I can't understand the below scenarion as well. The value 'i' represents the current row and when disabling the row why we need to take 'i-1'.
Attachments
testss.png
testss.png (7.82 KiB) Viewed 4389 times
#825151
Your for loop starts counting from 1, but the aRows array starts counting from 0, so you need to subtract 1 from i to get the corresponding row in your aRows array.
lalinda74 wrote:I have two checkbox columns in my grid view. I need to disable only the 'Other Sites Payments' column. Currently I'm disabling when the row doesn't have any checked check-boxes. Do you know a solution for this ?
Try this:
Code: Select all
var numRows = $("#saq_gridVendorData").getNumberRows();
var aRows = $("#saq_gridVendorData").find("div.pmdynaform-grid-row");

for (i = 1; i <= numRows; i++) { 
  var otherSitesCheck = $("#saq_gridVendorData").getValue(i,4);
  var blockVendorCheck = $("#saq_gridVendorData").getValue(i,5);
  $(aRows[i-1]).find("input[type=checkbox]").attr("disabled", true);
  if (otherSitesCheck == '0') {
     $(aRows[i-1]).find("input[type=checkbox]").eq(0).attr("disabled", true);
  }
  else{
    $(aRows[i-1]).find("input[type=checkbox]").eq(0).attr("disabled", false);
  }
}

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]

Betvisa clone scripts are pre-built software solut[…]