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..