Announcement

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

    Editing embedded grid

    Hi,

    I've looked over your experimental "embedded grid" example...Looks very nice...but i have a question, maybe it's silly..Let's suppose i have a context menu on the TreeGrid and when i select the "Add new" from the menu, i want to open a new editable record inside the embedded datasource, not his own datasource. Is it possible?

    here is some kind of example

    Code:
    isc.Menu.create
    ({
        ID:"contxtMenu",
        width:150,
        data:
        [
            {title:"Add new , click:"mainTree.startEditingNew()"},
            {title:"Delete"}
        ]
    });
    
    isc.DataSource.create({
        ID:"measures",
        fields:
        [
            {
                title:"Name",
                canEdit:true,
                required:true,
                type:"text",
                length:128,
                name:"name"
            },
            {
                title:"Gap",
                required:true,
                hidden:true,
                type:"text",
                length:128,
                foreignKey:"gaps.name",
                name:"gap"
            }
        ],
        tableName:"measure",
        testFileName:"../measures.xml"
     })
    
    isc.DataSource.create({
        ID:"gaps",
        dataURL:"../gaps.xml",
        recordXPath:"/Competences/competence",
        fields:
        [
            {type:"text", title:"Name", name:"name",primaryKey:true,
                required:true,canEdit:false}
        ]
      });
    
        isc.TreeGrid.create({
        ID: "mainTree",
        dataSource: "gaps",
        loadDataOnDemand:false,
        showConnectors: true,
        recordContextClick: "contxtMenu.showContextMenu(); return false;",
        recordClick: function ()
        {
           
           var r = gapsTree.getSelectedRecord();
    		    if (r.type=="competence" )
    		    {
    		       if (isOpened=="false")
    		       {
    			        gapsTree.openRecordDetailGrid(r,measures);
    			        isOpened="true";
    			   }
    			   else
    			   {
    			        gapsTree.closeRecord(r);
    			        isOpened="false";
    			   }
    			}
    	},
        nodeIcon:"../../exampleImages/icons/16/folder_document.png",
        folderIcon:"../../exampleImages/icons/16/folder_document.png",
        showOpenIcons:false,
        canEdit:true,
        fields: 
        [
            {name: "name",width:240,title: "Name" }
        ]
       
      });
    So basically i want to edit the "measures", not the "gaps"..

    Thank you.

    #2
    We'd recommend you show the editor as a pop-up Dialog, perhaps placed immediately beneath the record, both because the embedded grid functionality is experimental and because of using a different DataSource.

    Comment


      #3
      That is what i thought too...Thanks for your quick reply!

      Comment

      Working...
      X