Skip to content

Replies

0
vanitha
vanitha answered on Nov 17, 2017 1:36 PM

Hi Maya,

I am not using multi column header , that are individual column only.

Thanks,

Vanitha

0
vanitha
vanitha answered on Nov 17, 2017 12:51 PM

Hi Maya,

please find my sample code. I want to show the grid data (mobileno or email id) based on radio button and which is to be populated based on userid combo selection

Radio Button

<%= Html.Label("Contact Type In :", new { @Class="page-section-field-label-style"}) %>
<input id="radm" type="radio" class="Contact" name="Contact" value="Mobile" onclick = "clickAction(this)"  checked="checked"/>Mobile
<input id="rade" type="radio"  class="Contact" name="Contact" value="Email"  onclick ="clickAction(this)" />Email

// Grid

 

Radio button click

function clickAction(contact)
 {               
   var val = contact.value;                                
   if (val == "Mobile")
     {
          $("#gridUserInformation").igGrid("showColumn", "Mobile");
          $("#gridStockInformation").igGrid("hideColumn", "Email");
     }  
   else
     {
          $("#gridUserInformation").igGrid("showColumn", "Email");
          $("#gridStockInformation").igGrid("hideColumn", "Mobile");
      }
 }

// Combochange in grid

function UserIdChange(evt, ui) {                
   var userId= ui.items[0].data.Value;               
   if ($("input[type='radio'].contact").is(':checked'))
     {
         var cval = $("input[type='radio'].contact:checked").val();
     }                
                  //Passing selected value to the controller and retriving json object
   $.getJSON('GetContactData', { id: userId, contacttype: cval}, function (data) {
 
   if (cval == "Mobile")
     {
        var m = $("#gridUserInformation").igGridUpdating("editorForKey", "Mobile");
        m.igTextEditor("value", data[0]);
     }
  else
    {
        var email = $("#gridUserInformation").igGridUpdating("editorForKey", "Email");
        email.igTextEditor("value", data[1]);
    }

 

if I assign values for both in combo userid change, based on radiobutton value it is getting following error : cannot call methods on igtexteditor prior to initialization, attempted to call method ‘value’.

please help on this..

0
vanitha
vanitha answered on Nov 17, 2017 7:20 AM

Hi Maya,

Show / Hide columns are working fine but the values in those columns are not persisting.

For eg, when I change the radio button, column value in current row only  changed as per radio button, but it is not  binding the column value for existing row. it is in empty and if I click the existing row then the value will be populated.

 how to resolve this one .