Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
515
Drag and Drop rows between Webdatagrids
posted

I have 11 grids on a page that i'm dragging and dropping between using v15.1 of the ig controls. I have the drag and drop set to use an anchor in a TemplateDataField in the grids. When i drop i get the id of the dropped record, pass it to the back end in a hidden field and rebind all the girds. This works pretty well.

The problem now is getting the rest of the values in the row and passing them along. The other values are in columns using editor providers. Really i need to drag the row, not just an anchor, and have the row's data available to me.

Thanks

Ten

 function app_loaded() {

            _dd = new $IG.DragDropBehavior();
            _dd.get_events().addDropHandler(drop);

            var ids = $('#<%=Block0.ClientID%>').val().split(",");

            for (var i = 0; i < ids.length; i++) {

                var item = $get("source-" + ids[i]);
                if (item != null) {
                    _dd.addSourceElement(item, true);
                }


            }
            _dd.addTargetElement($get("dropDestination"), true);
            _dd.addTargetElement($get("dropDestination1"), true);
            _dd.addTargetElement($get("dropDestination2"), true);
            _dd.addTargetElement($get("dropDestination3"), true);
            _dd.addTargetElement($get("dropDestination4"), true);
            _dd.addTargetElement($get("dropDestination5"), true);
            _dd.addTargetElement($get("dropDestination6"), true);
            _dd.addTargetElement($get("dropDestination7"), true);
            _dd.addTargetElement($get("dropDestination8"), true);
            _dd.addTargetElement($get("dropDestination9"), true);
            _dd.addTargetElement($get("dropDestination10"), true);
...

 function drop(sender, eventArgs) {

            var source = eventArgs.get_manager().get_source().element;
            var id = source.id.split("-")[1];
            var ele = $('#' + source.id)
            var sourcediv = ele.closest('.DropDestination')
            $get("<%= hdnitemid.ClientID %>").value = id;
            $get("<%= hdnBlockFrom.ClientID %>").value = sourcediv.attr("id");
            $get("<%= hdnBlockTo.ClientID %>").value = eventArgs.get_manager()._curTargs[0].element.attributes["id"].value;
            var targetgrid = $find(eventArgs.get_manager()._curTargs[0].element.attributes["id"].value);
            var sourcegrid = $find(sourcediv.attr("id"));

           $("#<%= Block1Click.ClientID %>")[0].click();
        }

....

  <Columns>
                                          
                                               <ig:TemplateDataField Key="ID"  Header-Text="Worker" >
                                            
                                            <ItemTemplate>
                                            <a href="javascript:void(0);" id="sourceblock1-<%# Eval("Id") %>"> <%# Eval("EmployeeName") %></a>
                                            
                                            </ItemTemplate>
                                            </ig:TemplateDataField>
                                            <ig:BoundDataField Hidden="true" DataFieldName="EmployeeName" Key="EMPNAME" Header-Text="Worker"/>
                                            <ig:BoundDataField DataFieldName="EskInt" Key="EskInt" Hidden="true" />
                                            <ig:BoundDataField DataFieldName="EmployeeJustName" Key="EmployeeJustName" Hidden="true" />
                                            <ig:BoundDataField DataFieldName="Workplace" Key="Workplace"  Header-Text="Workplace" />
                                            <ig:BoundDataField DataFieldName="DeployFunction" Key="DeployFunction" Header-Text="Function"  />
                                        </Columns>
...

Parents Reply Children
No Data