|
@(Html.EJ().GroupButton("ColorGroupButton")
.Width("100%")
.Height("100%")
.GroupButtonMode(GroupButtonMode.RadioButton)
.ShowRoundedCorner(true).GroupButtonFields(gf => gf.Text("Color"))
)
@(Html.EJ().GroupButton("SizeGroupButton")
.Width("100%")
.Height("100%")
.GroupButtonMode(GroupButtonMode.RadioButton)
.ShowRoundedCorner(true).GroupButtonFields(gf => gf.Text("Size"))
) |
|
function readColor() {
var colorGroupButtonObj = $('#ColorGroupButton').data("ejGroupButton");
colorGroupButtonObj.option("selectedItemIndex", [-1]);
$.ajax({
url: '@Url.Action("Read_ProdColor")',
dataType: "json",
data: {
'prod': $("#Prod").data("ejDropDownList").model.text,// returns selected value in the dropdown
},
type: "POST",
success: function (val) {
colorGroupButtonObj.option("dataSource",val);//updating datasource of the groupbutton on selecting a product
},
error: function (result) {
alert("error");
}
});
}
function readSize() {
var sizeGroupButtonObj = $('#SizeGroupButton').data("ejGroupButton");
sizeGroupButtonObj.option("selectedItemIndex", [-1]);
$.ajax({
url: '@Url.Action("Read_ProdSize")',
dataType: "json",
data: {
'prod': $("#Prod").data("ejDropDownList").model.text, // returns selected value in the dropdown
},
type: "POST",
success: function (val) {
sizeGroupButtonObj.option("dataSource", val); //updating datasource of the groupbutton on selecting a product
},
error: function (result) {
alert("error");
}
});
} |
|
function btnClick(args) {
$.ajax({
url: '@Url.Action("Save_Data")',
dataType: "json",
data: {
'prod': $("#Prod").data("ejDropDownList").model.text,
'color':$('#ColorGroupButton').data("ejGroupButton").element.find(".e-active .e-btntxt").text(),
'size':$('#SizeGroupButton').data("ejGroupButton").element.find(".e-active .e-btntxt").text(),
'qty': $('#quantity').data("ejNumericTextbox").model.value,
},
type: "POST",
success: function (val) {
$('#quantity').data("ejNumericTextbox").option("value","");
},
error: function (result) {
alert("error");
}
});
} |