General Interface is an open source project hosted by the Dojo Foundation

GI Contributor Blog Blog from Jan 19, 2011

  2011/01/19
Displaying the select edit mask with drop down indicator on Matrix column
Last Changed by Darren Hwang, Mar 21, 2011 18:52
Labels: matrix, editmask

This format handler will style a Select mask column with the down arrow indicator. This replaces the default @lookup format handler for a select mask column

    var selectFormat = function(objDiv, strCDFKey, objMatrix, objMatrixColumn, intRowNumber, objServer) {
        var objMask = objMatrixColumn.getEditMask();
        if (objMask != null && typeof(objMask.getRecordNode) == "function") {
          var objNode = objMatrix.getRecordNode(strCDFKey);
          if (objNode) {
            var strValue = objMatrixColumn.getValueForRecord(strCDFKey);
            var lookupNode = objMask.getRecordNode(strValue);
            objDiv.innerHTML = jsx3.util.strEscapeHTML(
                lookupNode ? lookupNode.getAttribute("jsxtext") : (strValue != null ? strValue : ""));
          }
          objDiv.style.backgroundImage = "URL(JSX/images/select/arrowmask.gif)";
          objDiv.style.backgroundRepeat= "no-repeat";
          objDiv.style.backgroundPosition = "top right";
        }
      };

Note:

Using Format Handler is very Javascript intensive, especially for large number of rows(and or columns). Do not use this if you need to support IE6/7. You've been warned.

http://www.generalinterface.org/docs/display/GIDOCS/Content+Formatting+and+Localization#ContentFormattingandLocalization-ww1852740

Posted at 19 Jan @ 11:24 AM by Darren Hwang | 0 Comments