Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 28, 2011 11:33 AM by jeyaseelan@ajsquare.net
Member
40 Points
5 Posts
Jun 28, 2011 05:38 AM|LINK
/// <summary>Declare Namespace Ranveer</summary>
if (typeof Ranveer === "undefined") {
Ranveer = {};
}
/// <summary>Declare Namespace Ranveer.RulesEngine</summary>
if (typeof Ranveer.Common === "undefined") {
Ranveer.Common = {};
$(document).ready(function () {
Ranveer.Common.Scripts.initialize();
});
//////////////////////////Ranveer.Common.Scripts//////////////////////////////
/// <summary>Declare Namespace Ranveer.Common.Scripts</summary>
Ranveer.Common.Scripts = (function () {
////////////////////////////Declare Private functions//////////////////////////////////////
function attachKeyEvents() {
/// <summary>Function to attach keypress event to body.</summary>
$("body").bind("keypress", keyPressed);
function keyPressed(e) {
/// <summary>Function to execute task on Enter and escape key</summary>
var code = e.keyCode ? e.keyCode : e.which;
if (code == 13 && e.srcElement.type != "textarea") {//Enter Key
$("input[isdefault=true]:button").triggerHandler("click");
else if (code == 27) {//Escape Key
$("input[iscancel=true]:button").triggerHandler("click");
function attachRadioClickEvent() {
/// <summary>Function to attach click event on radio button</summary>
$("span[enableclickonlabel=true]").bind("click", radioButtonClicked);
function attachCheckBoxClickEvent() {
/// <summary>Function to attach click event on check box button</summary>
$("span[enableclickontext=true]").live("click", checkBoxClicked);
function radioButtonClicked() {
/// <summary>Function executed on click event on radio button</summary>
$(this).children("input:radio").attr("checked", "checked");
function checkBoxClicked() {
/// <summary>Function executed on click event on check box button</summary>
if ($(this).prev().children("input:checkbox").is(':disabled')) {
return;
if ($(this).prev().children("input:checkbox").is(':checked')) {
$(this).prev().children("input:checkbox").attr("checked", false);
else {
$(this).prev().children("input:checkbox").attr("checked", true);
//============================End Private functions======================================
////////////////////////////Declare Public functions//////////////////////////////////////
return {
//Public members
initialize: function () {
/// <summary>Function to call on initialize page.</summary>
attachKeyEvents();
attachRadioClickEvent();
attachCheckBoxClickEvent();
},
showWaitCursor: function () {
/// <summary>Function to call to show wait cursor.</summary>
$("body").css("cursor", "progress");
resetCursor: function () {
/// <summary>Function to call to set default cursor</summary>
$("body").css("cursor", "auto");
//============================End Public functions======================================
})();
Contributor
5124 Points
2025 Posts
Jun 28, 2011 11:33 AM|LINK
Ranveer,
u didnt specied your isseu, can you explin about that?
ranveer_msss
Member
40 Points
5 Posts
AJAX Request Handling
Jun 28, 2011 05:38 AM|LINK
/// <summary>Declare Namespace Ranveer</summary>
if (typeof Ranveer === "undefined") {
Ranveer = {};
}
/// <summary>Declare Namespace Ranveer.RulesEngine</summary>
if (typeof Ranveer.Common === "undefined") {
Ranveer.Common = {};
}
$(document).ready(function () {
Ranveer.Common.Scripts.initialize();
});
//////////////////////////Ranveer.Common.Scripts//////////////////////////////
/// <summary>Declare Namespace Ranveer.Common.Scripts</summary>
Ranveer.Common.Scripts = (function () {
////////////////////////////Declare Private functions//////////////////////////////////////
function attachKeyEvents() {
/// <summary>Function to attach keypress event to body.</summary>
$("body").bind("keypress", keyPressed);
}
function keyPressed(e) {
/// <summary>Function to execute task on Enter and escape key</summary>
var code = e.keyCode ? e.keyCode : e.which;
if (code == 13 && e.srcElement.type != "textarea") {//Enter Key
$("input[isdefault=true]:button").triggerHandler("click");
}
else if (code == 27) {//Escape Key
$("input[iscancel=true]:button").triggerHandler("click");
}
}
function attachRadioClickEvent() {
/// <summary>Function to attach click event on radio button</summary>
$("span[enableclickonlabel=true]").bind("click", radioButtonClicked);
}
function attachCheckBoxClickEvent() {
/// <summary>Function to attach click event on check box button</summary>
$("span[enableclickontext=true]").live("click", checkBoxClicked);
}
function radioButtonClicked() {
/// <summary>Function executed on click event on radio button</summary>
$(this).children("input:radio").attr("checked", "checked");
}
function checkBoxClicked() {
/// <summary>Function executed on click event on check box button</summary>
if ($(this).prev().children("input:checkbox").is(':disabled')) {
return;
}
if ($(this).prev().children("input:checkbox").is(':checked')) {
$(this).prev().children("input:checkbox").attr("checked", false);
}
else {
$(this).prev().children("input:checkbox").attr("checked", true);
}
}
//============================End Private functions======================================
////////////////////////////Declare Public functions//////////////////////////////////////
return {
//Public members
initialize: function () {
/// <summary>Function to call on initialize page.</summary>
attachKeyEvents();
attachRadioClickEvent();
attachCheckBoxClickEvent();
},
showWaitCursor: function () {
/// <summary>Function to call to show wait cursor.</summary>
$("body").css("cursor", "progress");
},
resetCursor: function () {
/// <summary>Function to call to set default cursor</summary>
$("body").css("cursor", "auto");
}
}
//============================End Public functions======================================
})();
jeyaseelan@a...
Contributor
5124 Points
2025 Posts
Re: AJAX Request Handling
Jun 28, 2011 11:33 AM|LINK
Ranveer,
u didnt specied your isseu, can you explin about that?
J.Jeyaseelan