Author Topic: Show values in group summary row and perform some action on fields  (Read 2288 times)

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Hello Support Team,

We are trying to add some custom fields on the group summary row and want to add some functionality on these fields.
We need Model and Begin Date Fields on grid please find screen shot for reference.
Please Check Code for Adding data into Model and Begin Date columns on summary row.
  {
        dataIndx: "state",
        align: "center",
        title: "Model",
        minWidth: 70,
        cb: {
          header: false,
          select: true,
          all: true
        },
        editor: false,
        render: function(ui) {
          if (ui.rowData.pq_close != undefined) {
              return "<input type='checkbox' class='prModel' value='" + ui.rowData[0] + "'/>";
          }
        }
      },
      {
        title: "Begin Date",
        width: 100,
        editor: {
          type: 'textbox',
          init: dateEditor
        },
        render: function(ui) {
          if (ui.rowData.pq_close != undefined && ui.rowData.pq_children != undefined) {
            var bdateObject = $("#begin_date").datepicker("getDate");
            var date = $.datepicker.formatDate("M-y", bdateObject);
            return "<input type='text' id='proDate' value='" + date + "' style='width:60px;border:none;background:none;'>";
          }
        }
      },

On model checkbox check/unchecked we are performing some functionality to decrements the values in other grid. But after checked the model checkbox if we try to add, update, delete or any other operation on the grid it will auto unchecked the checked values.
Once model is checked it must remain checked until refresh or manual uncheck.

Also, we want to show calendar dropdown on the begin date column so when we are change the calendar date for group we want to perform some actions.
For Example:
In the Grid if the Begin date is Aug-17 than data show from the month Aug-17 and if the Begin Date is Sep-17 the column will be blank until the month Sep-17.
And if we select date in Begin Date calendar Oct-17 than for that project column will be blank until the month Oct-17.

Please find screenshots for reference and provide your suggestion if it is possible to achieve.

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Re: Show values in group summary row and perform some action on fields
« Reply #1 on: November 15, 2017, 06:26:45 pm »
Hello Team,

Please Find Attached Screenshot, Because of some unknown issue the previous images not showing.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6260
    • View Profile
Re: Show values in group summary row and perform some action on fields
« Reply #2 on: November 16, 2017, 03:52:36 pm »
checkbox column should have type:'checkbox' and checkbox state should be saved and read from the same field.

In your case type:'checkbox' is missing and it's reading the vaue from ui.rowData[0] which looks incorrect.

Also the group titles and group summary rows are temporary rows which are created afresh whenever grouping takes place

Any addition or deletion of row in the grid causes regrouping and group title and summary rows are recreated and hence lose any manually inserted values.