Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Programmatically determined emptyCellValue question

    I am using SmartClient_v111p_2017-07-03_LGPL with IE11.

    I have a TreeGrid with a date field which conditionally may be edited. The popup calendar works great. Under certain circumstances on non-editable fields, I need to display “TBD” or “N/A” instead of a date. I tried emptyCellValue on the fields, but it is evaluated once on the create, even though it is a function. Is there a way to have a date field and optionally display a programmatically determined string?


    #2
    You seem to be talking about formatting rules on the field when it's not being edited, so just apply a CellFormatter.

    Comment


      #3
      I found examples of the cellFormatter, but they are all declared server side. I have been trying to use cellFormatter on the field of a LGPL tree grid, but the formatting function is not called. I set a break point in the function. The tree grid is created the data source is set at a later time. Can you tell me where I went wrong?

      Code:
      isc.TreeGrid.create({
      ...
      fields: [
      ...
      { name: "StartDatePlanned", title: "Start Date" , width: 100, canEdit: true , cellAlign: "center", align: "center", changed: "CalcProjectOnSite(this, 'StartDate')", cellFormatter: function (value, record, rowNum, colNum) { return StartDateFormatter(value, record, rowNum, colNum); } },
      ...
      ],
      ...
      });

      Comment


        #4
        There's no server-side CellFormatter API - what's confused you is that you've posted in the SmartGWT forum, where client-side code is written in Java and some APIs are named differently.

        The corresponding SmartClient API is listGridField.formatCellValue.

        Comment

        Working...
        X