3

I am implementing jquery data table. In each row there are 2 radio buttons. My problem is in a row both radio buttons are getting selected if click on it where as in a column only one radio button is getting selected. I need exactly reverse condition. Here is my code.

initialiseDataTable : function(){
    oTable = $('#example').dataTable({ bJQueryUI: true,
    "bPaginate": false,
    "bInfo": false,
    "bRetrieve":true,
    "sPaginationType": "full_numbers"})

   .makeEditable({
                  sUpdateURL: function(value, settings)
                              {
                                      return(value);
                              },
                              "aoColumns": [

                       {
                            type: 'checkbox',
                            onblur: function(value) {
                               return (value); }
                       },

                       {    
                            onblur: function(value) {
                               return (value); }
                       },

                       {  
                           onblur: function(value) {
                               return (value); }
                       },

                       { 
                           type: 'radio',
                           onblur: function(value) {
                               return ("true"); }
                       },
                       { 
                           type: 'radio',
                           onblur: function(value) {
                               return ("true"); }
                       }
                    ]
              });

   },

In HTML file,

<%for(var i=0;i<exceptionMappingData.length;i++){%>
<%if(exceptionMappingData[i].attributes != undefined && exceptionMappingData[i].attributes !=null && exceptionMappingData[i].attributes !='') {%>
<tr>
 <td><input name="" type="checkbox" id='' class=""/></td>
 <td class="read_only"><%=exceptionMappingData[i].attributes.organizationVO.name%></td>
 <td><%=exceptionMappingData[i].attributes.mappedBR%></td>
 <td><input type="radio" id='' class="" name="docTypeGroup"/></td>
 <td><input type="radio" id='' class="" name="docTypeGroup"/></td>
</tr>
<%}}%>

How to allow to select only one radio button? Also how to get selected radio button value?

pan1490
  • 939
  • 1
  • 7
  • 25
  • Yes. For one row,only one radio button should get selected. But in my case it is happening for a column. – pan1490 Apr 10 '14 at 05:48
  • I do not know anything about jquery-datatable. But can you please try with this below code. (In short set the Radio button name based on Row, so each row's radio button have different name) '' – Jayesh Goyani Apr 10 '14 at 05:49
  • @pan1490 Did you find a solution for this issue ? – javaxiss Sep 11 '14 at 08:34
  • @javaxiss After so many research I found this. http://www.jqwidgets.com/community/topic/adding-radio-button-to-the-grid/ Radio button column is not supported. But there were some other issues as well so I changed to jquery appendgrid. Check below link http://appendgrid.apphb.com/Demo – pan1490 Sep 12 '14 at 10:38

0 Answers0