Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum Undefined datagrid customformat column

  • Undefined datagrid customformat column

    Posted by Obonye on October 27, 2024 at 3:07 pm

    Dear All,

    I’m working on the sample library jsDataGrid Formatting. I noticed that if I change the list definition from instance variables and instead define it from a sql table class, the data entered into the datagrid columns change to “undefined”. If I tab out of the column entry and back again into the entry column, the previous data entered is visible. If I tab out the entry cell it changes to “undefined”. What could be causing this?

    The datagrid object is in a js remote form.

    Regards

    Martin O.

    Andreas Pfeiffer replied 9 months ago 2 Members · 7 Replies
  • 7 Replies
  • Andreas Pfeiffer

    Administrator
    October 29, 2024 at 9:53 am

    Hi Martin,

    Are you using the internal methods, i.e. $select? If so, can you check if the schema class is assigned to the $sqlclassname property and that the schema class has the columns that you expect?

    Best,

    Andreas

  • Andreas Pfeiffer

    Administrator
    October 29, 2024 at 1:36 pm

    Martin,

    One more thing.

    Is this a user defined grid? If so, make sure that the $columndatacol property of each column fits with the column name of the list column.

    Best,

    Andreas

  • Obonye

    Member
    October 29, 2024 at 3:40 pm

    I have created an instance variable list with it’s subtyped assigned to a table class. Then I call a select statement from the table class to define the list. I right-click on the iList and yes, the columns are correctly defined. The datagrid is userdefined. The columns mode is defined as custom format. I also noticed that is I prefix the column names with the list eg iList.ColName, the undefined error goes away. But if I tab out of the column entry field, what I have entered becomes invisible.

    • Obonye

      Member
      October 29, 2024 at 5:56 pm

      I meant to say, if I prefix the $columndatacol with the variable list like this: iList.EmployeeFirstName, the undefined errors goes away. Though I’m not sure if this is the correct way of solving the problem. Now the issue, the data entered disappears in the column entry cell on event after.

      • This reply was modified 9 months ago by  Obonye Mato.
      • Andreas Pfeiffer

        Administrator
        October 30, 2024 at 12:44 pm

        should be the column name only.

        Best,

        Andreas

        • Obonye

          Member
          October 31, 2024 at 7:53 am

          the datagrid object has a $formatcell method:


          Calculate <b style=”background-color: var(–bb-content-background-color); font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>lValue as <b style=”background-color: var(–bb-content-background-color); font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>iList.[<b style=”background-color: var(–bb-content-background-color); font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>pRow].[<b style=”background-color: var(–bb-content-background-color); font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>pCol]

          If pCol<>1

          Calculate lValue as jst(lValue,’n2′)

          End If

          # note, client executed method requires color parameter to be a string unless using a constant. Can alternativley be a HTML color string eg. ‘#FF0000’

          If iList.[pRow].iTotal<0

          # Calculate iHtml as styledtohtml(con(style(kEscColor,’#FF0000′),style(kEscStyle,kBold),lValue))

          Calculate iHtml as styledtohtml(con(style(kEscColor,’rgba(255,0,0,1)’),style(kEscStyle,kBold),lValue))

          Else

          Calculate iHtml as styledtohtml(con(style(kEscColor,kDarkGreen),style(kEscStyle,kItalic),lValue))

          End If

          Quit method iHtml


          Could this cause an issue with the command Do <b style=”background-color: var(–bb-content-background-color); font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>iList.$definefromsqlclass($tables.taPerson)

          • Andreas Pfeiffer

            Administrator
            November 4, 2024 at 10:35 am

            Martin,

            I don’t think so. However you can easily test it by omitting this code temporarily and see if it has any effect.

            Best,

            Andreas

Log in to reply.