Setting the HTML Value of a Cell by Row ID

This API replaces the HTML content of a cell with new HTML code. This API should only be used on cells in a column where the Column Type setting is set to programHTMLOutput.

For example, a column can be configured with an On Change Handler function so that when its value is updated, it can automatically update the HTML code in another cell.

emxEditableTable.setCellHTMLValueByRowId

This API requires these input arguments:


  • rowId. The row ID of the needed cell.
  • colName. The column name of the needed cell.
  • strHTML. The HTML string to replace the current value. The string must be HTML5 compliant and enclosed within the <c> tag.
  • isRefreshView. A boolean value that when true (the default), refreshes the structure browser page.

As an example, this function is invoked by the On Change Handler and uses this API to insert an image link in a cell:

function onDescriptionChanged(){
     var checkboxes = getCheckedCheckboxes();
     var cBoxArray = new Array(); 
     var strSelectedLevelIds = "";
     var id= "";
     for(var e in checkboxes){
          cBoxArray[cBoxArray.length] = e;
     }
     if (cBoxArray.length==0) {
          alert ("select a checkbox in Name Column before using this command" );
     }

     for (var itr = 0; itr < cBoxArray.length; itr++) {
          var aIds = cBoxArray[itr].split("|");

          id = aIds[3];

          var objectIds = "";
          objectIds=aIds[1];

          var relIds = "";
          relIds=aIds[0];

          var directions = "";
          var RowId= "";
          var RowId1= "";
          var RowId2= "";
          var strHTML = '<c><span><img height="16" border="0" align="middle"
               src="images/iconSmallDesignSpecification.gif" /></span></c>';

          emxEditableTable.setCellHTMLValueByRowId(id,'progHTMLColumn',strHTML,true);
     }
     return true;
     }