Announcement

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

    startEditingNew & row selection

    Hello,

    is there a way to create a new row (startEditingNew) and have that row selected, in a in a ListGrid?

    More precisely, I'd like the SelectionEvent event to be fired also when a new row is added.

    Thanks

    #2
    I'm getting the same request for example to delete a row you just created... no way to select this new row?

    Alain

    Comment


      #3
      Same issue

      Is there a workaround? When I validate a row I check the selected row to compare two columns (a from data and a to date), what is not working for added rows
      Code:
      CustomValidator customValidator = new CustomValidator() {
        @Override
        protected boolean condition(Object value) {
          if (newRow || value == null || !StringMethods.isNumber(value.toString()))
            return true;
          if (periodsGrid.getSelectedRecord() != null && periodsGrid.getSelectedRecord().getAttribute("fromDate") != null) {
            Integer fromDate = periodsGrid.getSelectedRecord().getAttributeAsInt("fromDate");
            Integer toDate = Integer.parseInt(value.toString());
            if (fromDate.compareTo(toDate) > 0) {
              return false;
            }
          }
          return true;
        }
      };
      Last edited by meindert; 31 Oct 2012, 03:40.

      Comment

      Working...
      X