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

grid with button

0 Answers 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 25 Apr 2012, 06:41 PM
hello.
I have a problem with the buttons that I have for a grid with a radio button.
when selecting out of the box or button to select radiotbutton clears the entire contents of the cell.
any help is appreciated!
Greetings!

<div id="example" class="k-content">
           <div id="organizer">
          <ul id="panelbar">
               <li class="k-state-active">
                
                   <span class="k-link k-state-selected">producto 1</span>
                   
               <div id="example" class="k-content">
      
           <div id="rowSelection" style="width:620px; height:300px"></div>
 
          <script>
                 $(document).ready(function() {
                   $("#rowSelection").kendoGrid({
                       dataSource: {
                           data: FuncionDellenado(),
                           
                       },
                       selectable: "multiple",
                       pageable: true,
                       scrollable: true,
                       navigatable: true,
                      columns: [
                          { field: "FirstName", title: "productos", format: "{0:c}", type:"String",editable: false, width: "150px" },
                           { field: "City", title: "cantidad", editable:true, type:"Number", validation: { min: 1, required: true },width: "80px" },
                           {field: "BirthDate", title: "fecha de Entrega",type:"String",editable:true,width:"100px"},
                           { field: "Favoritos", template: "#= kendo.toString(\'<label \class=\"label_radio\"for=\"radio-01\">\<input name=\"sample-radio\" id=\"radio-01\" value=\"1\" type=\"radio\"/>\.\</label>\')##= kendo.toString(\'<label \class=\"label_radio\" for=\"radio-01\">\<input name=\"sample-radio\" id=\"radio-01\" value=\"1\" type=\"radio\" />\.\ </label>\') ##= kendo.toString(\'<label \class=\"label_radio\" for=\"radio-01\">\<input name=\"sample-radio\" id=\"radio-01\" value=\"1\" type=\"radio\" />\.\ </label>\') ##= kendo.toString(\'<label \class=\"label_radio\" for=\"radio-01\">\<input name=\"sample-radio\" id=\"radio-01\" value=\"1\" type=\"radio\" />\.\ </label>\') ##= kendo.toString(\'<label \class=\"label_radio\" for=\"radio-01\">\<input name=\"sample-radio\" id=\"radio-01\" value=\"1\" type=\"radio\" />\.\ </label>\') #", title: "Favoritos", width: "80px" },
                           { field: "añadir", template: "#= kendo.toString(\'<input type=IMAGE SRC=\"add.gif\"\id=\"añadir\" value=\"CODE\"  />\') #", title: "añadir", width: "210px" }
                            
                           ],
                           editable: true
                   });
 
                   $('#añadir').click(function () {
 
           var sourcegrid = $('#rowSelection').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
                
               destinationgrid.dataSource.add(dataItem);       // DESTINATION DATASOURCE
          
                      });
           
           
         destinationgrid.refresh();                          // MUST REFRESH THE DESTINATION GRID
          
           });
            
            
            
            
           });
           </script>

No answers yet. Maybe you can help?

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