Forum
14:41
21/02/2012
Hi All,
I have a checkboxbox button on the title bar for Add Dialog. I want it when tick on it, the recreateform set to true, Add Dialog will be refresh without closed Add dialog.
My script as below, however doesn't work
function triggerSession() {
if ($('#on').attr('checked')) {
trues = true;
}
else {
trues = false;
}
$('#on').attr('checked', trues);
jQuery("#list1").trigger("reloadGrid");
}
Please advise.
Thank you.
Regards,
Micheale
00:11
21/02/2012
Please Help.
I have change to:-
function setTrigger() {
var on = "false";
if ($('#on').attr('checked')) {
on = "true";
}
else {
on = "false";
}
$.ajax({
type: "POST",
url: '@Url.Content("~/Home/SetSession")',
data: JSON.stringify(on),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
//alert(data);
$("#list1").trigger("reloadGrid", [{ current: true}]);
$('#on').attr('checked', data);
},
error: function () {
}
});
}
public JsonResult SetSession(string on)
{
JsonResult result = new JsonResult();
result.Data = on;
result.ContentType = null;
result.ContentEncoding = null;
result.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
return result;
}
My View Using JQGrid:
var addDialog = {
url: '@Url.Content("~/Home/AddMaster")',
addCaption: "Add Record <input type='checkbox' name='on' id='on' onclick='setTrigger()' /> Field Entry Retention",
recreateForm: @trues,
Thank you.
Regards,
Micheale
02:39
21/02/2012
Hi All,
I finally figure out stupid method but work! Now, leave how to trigger Click on 'Add Button' for current dialog, my red bold section code is something wrong?
Please Help.
var dlg = $(formid).closest('div.ui-jqdialog');
$('#on').click(function () {
var on = "false";
if ($('#on').attr('checked')) {
on = "true";
}
else {
on = "false";
}
if (on == "true") {
$('#on').attr('checked', false);
localStorage['on']="false";
$('.ui-jqdialog-titlebar-close', dlg).trigger('click');
window.location.reload(true);
$('.ui-jqdialog-content td.AddButton', dlg).trigger('click');
}
else {
$('#on').attr('checked', true);
localStorage['on']="true";
$('.ui-jqdialog-titlebar-close', dlg).trigger('click');
window.location.reload(true);
$('.ui-jqdialog-content td.AddButton', dlg).trigger('click');
}
});
Thank you.
Regards,
Micheale
09:39
21/02/2012
I manage to solved it by using
gridComplete: function () {
if (localStorage['tick'] == "1″) {
var grid = jQuery("#list1″);
jQuery('.ui-icon-plus').click();
localStorage['tick'] = "0″;
}
},
The pop up succesfully displayed, but seem load twice. When i closed the pop up,My JQGrid UI still in bind mode.
This is due to I having 2 nav bar: clonetotop: true. Arghhh, How can i just defined 1 click will do on the red bold code?
Please advise.
Thank you.
Regards,
Micheale
Most Users Ever Online: 715
Currently Online:
46 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66