This is a migrated thread and some comments may be shown as answers.

copy text from one grid to another grid editable uneditable

0 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 03 May 2012, 06:03 PM
hello I have a grid that is editable and copy a row to another grid that is editable if it gets copied but not editable and when you pass the second grid if need be editable.

my code I have it in this way

<div id="domSelection" style="width:620px; height:300px"></div>
 <script>
                 $(document).ready(function() {
                   $("#domSelection").kendoGrid({
                       dataSource: {
                           data: addItems(),
                        
                       },
                       selectable: "multiple",
                       pageable: true,
                       scrollable: true,
                       navigatable: true,
                      columns: [
                          { field: "FirstName", title: "name", format: "{0:c}", type:"String",editable: false, width: "150px" },
                                                      { field: "add", title: "add", width: "120px" }
                            
                           ],
                           editable: false
                   });
 
               
                
                           $('#aƱadir').click(function () {
 
           var sourcegrid = $('#domSelection').data('kendoGrid');        //SOURCE GRID
          var destinationgrid = $('#Selection').data('kendoGrid'); // DESTINATION GRID
 
           sourcegrid.select().each(function () {
              var dataItem = sourcegrid.dataItem($(this));
               var column = dataItem.FirstName; // whatever the name of the unique id for your data source
               alert(column);
                
               destinationgrid.dataSource.add(dataItem);       // DESTINATION DATASOURCE
          
          });
           
         destinationgrid.refresh();                          // MUST REFRESH THE DESTINATION GRID
          
           });
            
                       });
           </script>
           <div id="Selection" style="width:600px;"></div>
        <script>
                $(document).ready(function() {
                   $("#Selection").kendoGrid({
                       dataSource: {
                           
                       },
                       selectable: "multiple",
                       pageable: true,
                       scrollable: true,
                       navigatable: true,
                       columns: [
                          { field: "FirstName", title: "name", format: "{0:c}", type:"String",editable: false, width: "150px" },
                            { field: "City", title: "city", editable:true, type:"Number", validation: { min: 1, required: true },width: "150px" },
                           {field: "BirthDate", title: "date", type:"String", editable: true, width:"150px"},
                             { command: ["edit", "destroy"], title: "Editar", width: "210px" }],
                      editable: true
                                                               
                   });
                    
               });
           </script>

do not know if there will be a way to make the copy when you pass a parameter for that can be edited in the second grid
or once you pass everything to the second grid is editable as a functional actualize it not editable editable.

if I put in the datasource.add (column) does not add
if I put the dataItem yes, but not editable in the second grid


regards.
and thanks in advance.
hopefully this answer me : (
or if I want to say something

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Ricardo
Top achievements
Rank 1
Share this question
or