smartclient listgrid 数据之间的拖拽

从listgrid1将信息拖拽到listgrid2内,方便灵活实现数据的传递


注意事项:

Listgrid1中增加属性

    canDragRecordsOuttrue,
    dragDataAction: "copy",

listgrid2 中增加属性

   canAcceptDroppedRecordstrue,
    canRemoveRecordstrue,
    preventDuplicatestrue,
    leaveScrollbarGapfalse,

注意:

Datasource1中的pk在datasource2中做fk,配置这一点时,当拖拽数据时出发add请求,并将所拖拽的数据传递给后台处理

(也可以从listgrid1中选中一行数据,单击蓝色图标触发:projectList.transferSelectedData(employeesList)事件

 

前台js代码(参考)

 

/**alluseremailDS**/

isc.DataSource.create({

    ID:"otherUserDS",

    dataFormat:"json",

    recordXPath:"data",

    fields:[{name:"name"},{name:"department"},{name:"id",primaryKey:true}],

   operationBindings:[{operationType:"fetch",dataURL:"com/el/ProjectEnd/findAllProjEndUser.action"}]

});

 

/**alluseremailListGrid**/

isc.ListGrid.create({

    ID: "otherUserList",

    width: 320,height: 384,

   dataSource:otherUserDS,

   alternateRecordStyles: true,

   canDragRecordsOut: true,

    dragDataAction:"copy",

   showFilterEditor:true,

   filterOnKeypress: true,

    autoFetchData: true,

    fields: [

    

       {name:"name",title:"姓名"},

       {name:"department",title:"部門"}

    ]

});

 

/**selectotheremialDS**/

isc.DataSource.create({

    ID:"selectOtherDS",

    dataFormat:"json",

    recordXPath:"data",

    fields:[{name:"name"},{name:"department"},{name:"id",foreignKey:"otherUserDS.id"}],

   operationBindings:[{operationType:"fetch",dataURL:"com/el/ProjectEnd/findProjEndUser.action"},

                      {operationType:"add",dataURL:"com/el/ProjectEnd/addProjEndUserByUserInfoId.action"},

                     {operationType:"remove",dataURL:"com/el/ProjectEnd/removeProjEndUserByUser.action",requestProperties:{httpMethod:"POST"} }

    ]

});

 

/**selectotherListGrid**/

isc.ListGrid.create({

    ID: "selectOtherUserList",

    width: 340,height: 364,

   dataSource:selectOtherDS,

   canAcceptDroppedRecords: true,

   canRemoveRecords: true,

    autoFetchData:false,

   alternateRecordStyles: true,   

   preventDuplicates: true,

   leaveScrollbarGap: false,

    fields: [

        {name:"name",title:"姓名"},

        {name:"department",title:"部門"}

    ]

});

 

 



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值