Announcement

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

    add new record in empty Tree grid

    Hi,

    in an empty treeGrid I want to adding New record to it with startEditingNew() but it does not work,
    in listGrid this function works!

    regards
    nazil

    #2
    Hi Nazil,

    startEditingNew() can't really work for trees because the rowNum alone does not always provide enough information to know where to add a new node to a Tree.

    Instead, add the node yourself (via Tree.add() or via DataSource.addData() for a databound TreeGrid) and then startEditing() once the node has been added.

    Comment


      #3
      add new record in empty Tree grid

      Hi,

      Here is my code, but does not work!
      Code:
      isc.TreeGrid.create({
          ID: "employeeTree",
          width: 500,
          height: 400,
          dataSource: "employees",
          nodeIcon:"icons/16/person.png",
          folderIcon:"icons/16/person.png",
          showOpenIcons:false,
          showDropIcons:false,
          closedIconSuffix:"",
          fields: [
              {name: "Name"},
              {name: "Job"}
          ],
          dataProperties: {openProperty: "isOpen"}
      });
      isc.IButton.create({
          ID:"bbb",
          left:550,
          click:"employees.addData();employeeTree.startEditing()"
      });
      regards
      nazil

      Comment


        #4
        employees.addData() should be passed data for the new node.

        You should startEditing only one addData() completes, by using the callback that addData() allows you to pass.

        Comment


          #5
          Hi,
          I use this:
          .
          .
          .
          click:"employees.addData(null, 'employeeTree.startEditing()');"

          but does not work!

          regards
          nazil

          Comment


            #6
            As previously mentioned:

            employees.addData() should be passed data for the new node.

            Comment


              #7
              How do you then allow for newly added node to the tree to delete itself when you cancel editing like it does in ListGrid?

              Comment

              Working...
              X