jQWidgets Forums

jQuery UI Widgets Forums Grid Microsoft JScript runtime error: 'undefined' is null or not an object

This topic contains 6 replies, has 2 voices, and was last updated by  Peter Stoev 12 years, 5 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • Hi there,

    I used jqxgrid. It is editable grid. I am setting the Gird’s column editable property dynamically on cellendedit event.

    when user selects first column value, the other columns edtiable property will be set based on the value selected in the dropdownlist.

    I got an error from jqxgrid.edit.js when setting the columnproperty.

    This is the error message : Microsoft JScript runtime error: ‘undefined’ is null or not an object

    Here is my Code snippet
    $(“#gvDDDetailsjqx”).bind(‘cellendedit’, function (event) {
    debugger
    var args = event.args;
    $(“#divGridDDEndEditEvent”).html(“Event Type: cellendedit, Column: ” + args.datafield + “, Row: ” + (1 + args.rowindex) + “, Value: ” + args.value);
    if (event.args.datafield = ‘PayMode’ && args.value == ‘Cash’) {

    $(“#gvDDDetailsjqx”).jqxGrid(‘setcolumnproperty’, ‘DDChequeNo’, ‘editable’, false);
    $(“#gvDDDetailsjqx”).jqxGrid(‘setcolumnproperty’, ‘DDDate’, ‘editable’, false);
    $(“#gvDDDetailsjqx”).jqxGrid(‘setcolumnproperty’, ‘BankName’, ‘editable’, false);
    $(“#gvDDDetailsjqx”).jqxGrid(‘setcolumnproperty’, ‘InFavour’, ‘editable’, false);
    }
    });

    Kindly reply me as soon as possible.

    thanks & regards
    Ramesh Gurunathan.


    Peter Stoev
    Keymaster

    Hi Ramesh,

    Could you please provide a sample with sample data which demonstrates the behavior you are writing about?

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    hi peter,

    Are you asking runnable project sample or just source code. Because my project uses sqlserver DB.

    Here is where the code bites.

    {if(!C.isNestedGrid){D.focus()}

    The Code I used to bind grid

    $(document).ready(function () {
    //debugger
    var theme = getTheme();

    var Batchprofile = {};

    var generaterow = function (i) {
    var row = {};

    row[“PayMode”] = “”;
    row[“DDChequeNo”] = “”;
    row[“DDDate”] = new Date;
    row[“BankName”] = “”;
    row[“InFavour”] = “”;
    row[“Amount”] = 0;
    row[“SeqNo”] = 0;
    return row;
    }

    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘PayMode’ },
    { name: ‘DDChequeNo’ },
    { name: ‘DDDate’ },
    { name: ‘BankName’ },
    { name: ‘InFavour’ },
    { name: ‘Amount’ },
    { name: ‘SeqNo’ }
    ],
    updaterow: function (rowid, rowdata, commit) {
    // synchronize with the server – send update command
    // call commit with parameter true if the synchronization with the server is successful
    // and with parameter false if the synchronization failder.
    commit(true);
    }
    };

    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getFeeComponentsJD’,
    type: ‘POST’,
    dataType: ‘json’,
    data: ‘{“Batchprofile”:’ + JSON.stringify(Batchprofile) + ‘}’,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    success: function (data) {
    source.localdata = data.d;
    },
    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dataAdapter = new $.jqx.dataAdapter(source);

    // initialize jqxGrid
    $(“#gvDDDetailsjqx”).jqxGrid(
    {
    width: 680,
    source: dataAdapter,
    editable: true,
    //theme: theme,
    selectionmode: ‘singlecell’,
    editmode: ‘click’,
    columns: [
    { text: ‘Pay Mode’, datafield: ‘PayMode’, columntype: ‘dropdownlist’, width: 67,
    createeditor: function (row, cellvalue, editor) {
    editor.jqxDropDownList({ displayMember: ‘PayMode’,
    valueMember: ‘PayModeID’, source: loadGridDropDownList(‘PayMode’, ‘PayModeID’, ‘PaymentMode’)
    });
    // editor.bind(‘select’, function (event) {
    // var selectedIndex = event.args.index;
    // var value = $(‘#gvDDDetailsjqx’).jqxGrid(‘getcellvalue’, selectedIndex, “PayMode”)
    // alert(“Selected Index” + selectedIndex + ” value ” +value);

    // });
    }

    },
    { text: ‘DD/ChequeNo’, datafield: ‘DDChequeNo’, columntype: ‘textbox’, width: 120 },
    { text: ‘DD Date’, datafield: ‘DDDate’, columntype: ‘datetimeinput’, width: 100,
    cellsalign: ‘right’, cellsformat: ‘d’,
    validation: function (cell, value) {
    var year = value.getFullYear();
    if (year >= 2013) {
    return { result: false, message: “Draft/Cheque Date should be before 1/1/2013” };
    }
    return true;
    }

    },
    { text: ‘Bank Name’, datafield: ‘BankName’, columntype: ‘dropdownlist’, width: 150,
    createeditor: function (row, cellvalue, editor) {
    editor.jqxDropDownList({ displayMember: ‘BankName’,
    valueMember: ‘BankID’, source: loadGridDropDownList(‘BankName’, ‘BankID’, ‘Bank’)
    });
    }

    },
    { text: ‘InFavour’, datafield: ‘InFavour’, columntype: ‘dropdownlist’, width: 150,
    createeditor: function (row, cellvalue, editor) {
    editor.jqxDropDownList({ displayMember: ‘FavourType’,
    valueMember: ‘FavourID’, source: loadGridDropDownList(‘FavourType’, ‘FavourID’, ‘InFavour’)
    });
    }

    },
    { text: ‘Amount’, datafield: ‘Amount’, columntype: ‘numberinput’, width: 80, cellsalign: ‘right’,
    validation: function (cell, value) {
    if (value <= 0) {
    return { result: false, message: "Amount should not be less than 0" };
    }
    return true;
    },
    initeditor: function (row, cellvalue, editor) {
    editor.jqxNumberInput({ digits: 8 });
    }

    },
    { text: 'SeqNo', datafield: 'SeqNo', columntype: 'textbox', width: 80 }
    ]
    });

    // create new row.
    $("#addrowbutton").bind('click', function () {
    var datarow = generaterow();
    var commit = $("#gvDDDetailsjqx").jqxGrid('addrow', null, datarow);
    });
    $("#cancelrowbutton").bind('click', function () {
    $('#gvDDDetailsjqx').jqxGrid('resumeupdate');
    });

    $('#gvDDDetailsjqx').jqxGrid('hidecolumn', 'SeqNo');
    $('#gvDDDetailsjqx').jqxGrid({ autoheight: true });

    // events
    $("#gvDDDetailsjqx").bind('cellbeginedit', function (event) {
    var args = event.args;
    $("#divGridDDbeginEditEvent").html("Event Type: cellbeginedit, Column: " + args.datafield + ", Row: " + (1 + args.rowindex) + ", Value: " + args.value);
    // if (event.args.datafield != 'PayMode') {
    // var value = $('#gvDDDetailsjqx').jqxGrid('getcellvalue', args.rowindex, "PayMode")
    // alert("Cell Value " + value);
    // }
    });

    $("#gvDDDetailsjqx").bind('cellselect', function (event) {
    var _columna = $("#gvDDDetailsjqx").jqxGrid('getcolumn', event.args.datafield);
    RowIndex = event.args.rowindex; //get the index
    ColumnIndex = event.owner._getcolumnindex(event.args.datafield);
    //$("#gvDDDetailsjqx").jqxGrid({ editmode: 'singlecell' });
    // if (_columna.columntype == "dropdownlist") {
    // var editable = $("#gvDDDetailsjqx").jqxGrid('begincelledit', RowIndex, event.args.datafield);
    // alert("Column Name " + event.args.datafield);
    // }
    // if (event.args.datafield != 'PayMode') {
    // var value = $('#gvDDDetailsjqx').jqxGrid('getcellvalue', RowIndex, "PayMode")
    // alert("Cell Value " + value);
    // }

    });

    });

    Cellendedit event

    $(document).ready(function () {

    $("#gvDDDetailsjqx").bind('cellendedit', function (event) {
    debugger
    var args = event.args;
    $("#divGridDDEndEditEvent").html("Event Type: cellendedit, Column: " + args.datafield + ", Row: " + (1 + args.rowindex) + ", Value: " + args.value);
    if (event.args.datafield = 'PayMode' && args.value == 'Cash') {

    $("#gvDDDetailsjqx").jqxGrid('setcolumnproperty', 'DDChequeNo', 'editable', false);
    $("#gvDDDetailsjqx").jqxGrid('setcolumnproperty', 'DDDate', 'editable', false);
    $("#gvDDDetailsjqx").jqxGrid('setcolumnproperty', 'BankName', 'editable', false);
    $("#gvDDDetailsjqx").jqxGrid('setcolumnproperty', 'InFavour', 'editable', false);
    }
    });

    });

    In my project we use Iframe where we load common load page It's Loadpage.aspx. there I used all the js files.
    I also have web usercontrols where I will call web service to get data from sql server DB.

    LoadPage.aspx

    <%—-%>

    <script src='’ type=”text/javascript”>

    <script src='’ type=”text/javascript”>

    My User control

    var locationUrl = ‘http://localhost:6776/AUT/Admission’;
    function SuggessionSelectedValues(Obj, controlName) {
    var dsProgramobj, dsProgramvalobj, idvalue;
    if (controlName == ‘dsBatchCentreAR’) {
    document.getElementById(”).value = Obj[0];
    idvalue = document.getElementById(”).id;
    dsProgramobj = idvalue.replace(‘txtBatchCentreAR’, ‘dsProgram_SuggessionTextBox’);
    dsProgramvalobj = idvalue.replace(‘txtBatchCentreAR’, ‘dsProgram_hdnSugValue’);
    document.getElementById(dsProgramvalobj).value = ‘-1’;
    document.getElementById(dsProgramobj).value = ”;
    }
    else if (controlName == ‘dsProgramSrchAR’) {
    document.getElementById(”).value = Obj[0];
    idvalue = document.getElementById(”).id;
    dsProgramobj = idvalue.replace(‘txtProgramSrchAR’, ‘dsProgram_SuggessionTextBox’);
    dsProgramvalobj = idvalue.replace(‘txtProgramSrchAR’, ‘dsProgram_hdnSugValue’);
    document.getElementById(dsProgramvalobj).value = ‘-1’;
    document.getElementById(dsProgramobj).value = ”;
    }

    }

    function SearchGridCheckBoxStatus() {
    var gv = document.getElementById(”);
    var gvControls = gv.getElementsByTagName(‘input’);
    var count = 0;
    document.getElementById(”).value = “0”;
    for (i = 0; i < gvControls.length; i++) {
    if (gvControls[i].type == "checkbox") {
    if (gvControls[i].name.match("chkSelect1")) {
    if (gvControls[i].checked) {
    count = 1;

    }
    }
    }
    }
    if (count == 0) {
    document.getElementById('’).value = “1”;

    }
    return count;
    }

    function Check() {
    var gv = document.getElementById(”);
    var gvControls = gv.getElementsByTagName(‘input’);

    for (i = 0; i < gvControls.length; i++) {
    if (gvControls[i].type == "checkbox") {
    if (gvControls[i].name.match("chkSelect1")) {
    var Action = gvControls[0].checked;
    if (i != 0) {
    if (Action == true)
    gvControls[i].checked = true;
    else
    gvControls[i].checked = false;
    }
    }
    }
    }
    if (Action == true) {
    document.getElementById('’).value = ‘True’;
    }
    else {
    document.getElementById(”).value = ‘False’;
    }

    }

    function CheckOne(ID) {
    // debugger
    var gv = document.getElementById(”);
    var Inputs = gv.getElementsByTagName(‘input’);
    var totalAmount = 0 * 1;

    for (i = 0; i < Inputs.length; i++) {

    var id = String(Inputs[i].id);

    if (Inputs[i].type == "checkbox") {
    var Action = Inputs[i].checked;
    if (Action == true) {
    if (Inputs[i + 1].type == 'text') {
    totalAmount = parseFloat(totalAmount) + parseFloat(Inputs[i + 1].value);
    }

    }
    }
    }

    document.getElementById('’).innerText = totalAmount + “.00”;
    }

    function datecontaincheck(evt) {
    if (window.event) {
    if (evt.keyCode >= 46 || evt.keyCode = 46 || evt.which <= 56)
    return true;
    }
    return false;
    }

    function calculateActualTotal() {
    var grid = document.getElementById('’);
    var total = 0 * 1;
    var paidtotal = 0 * 1;
    var fixedtotal = 0 * 1;
    var actualtotal = 0 * 1;
    if (grid != null) {
    var Inputs = grid.getElementsByTagName(‘input’);
    var index = 0;
    for (i = 0; i < Inputs.length; i++) {
    if (Inputs[i].type == 'checkbox') {
    if (Inputs[i].checked == true) {
    index += 1;
    var actualAmt = Inputs[i + 1].value; //lblActualAmt.innerText
    if (isNaN(parseFloat(actualAmt))) {
    //alert('I m in error');
    }
    else {
    total = parseFloat(actualAmt) + parseFloat(total);
    actualtotal = total;
    total = String(total);
    }
    var paidAmt = Inputs[i + 2].value;
    if (isNaN(parseFloat(paidAmt)))
    { }
    else {
    paidtotal = parseFloat(paidAmt) + parseFloat(paidtotal);
    fixedtotal = paidtotal;
    paidtotal = String(paidtotal);
    }
    }
    }

    }
    document.getElementById('’).value = actualtotal.toFixed(2);
    }
    }

    // jqxWBatchDateAR Bind Function
    $(document).ready(function () {
    var theme = getTheme();
    // Create a jqxDateTimeInput
    $(“#jqxWBatchDateAR”).jqxDateTimeInput({ width: ‘173px’, height: ’25px’, theme: theme });
    $(‘#jqxWBatchDateAR’).jqxDateTimeInput({ formatString: “dd-MM-yyyy” });
    $(‘#jqxWBatchDateAR’).bind(‘valuechanged’, function (event) {
    var date = event.args.date;
    });
    });

    // jqxWRequestDateAR Bind Function
    $(document).ready(function () {
    var theme = getTheme();
    // Create a jqxDateTimeInput
    $(“#jqxWRequestDateAR”).jqxDateTimeInput({ width: ‘173px’, height: ’25px’, theme: theme });
    $(‘#jqxWRequestDateAR’).jqxDateTimeInput({ formatString: “dd-MM-yyyy” });
    $(‘#jqxWRequestDateAR’).bind(‘valuechanged’, function (event) {
    var date = event.args.date;
    });
    });

    //********* Program Combo Load *************
    $(document).ready(function () {
    var theme = getTheme();
    //debugger
    // prepare the data

    var dataAdapter = new $.jqx.dataAdapter(source);
    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘ProgramID’ },
    { name: ‘ProgramName’ },
    ]
    //,url: ‘AdmissionRequest.asmx/getRequestTypeJsonData’,
    //async: false
    };

    //var dataString = “fromDate: ” + fromDate + ” , toDate: ” + toDate;
    //Getting the source data with ajax GET request
    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getProgramsJD’,
    type: ‘GET’,
    dataType: ‘json’,
    data: “{}”,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    success: function (data) {
    source.localdata = data.d;
    },
    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dataAdapter = new $.jqx.dataAdapter(source);
    dataAdapter.dataBind();

    // Create a jqxComboBox
    $(“#cmbProgramjqx”).jqxComboBox({ selectedIndex: 0, source: dataAdapter,
    displayMember: “ProgramName”,
    valueMember: “ProgramID”,
    width: 250, height: 25, theme: theme });

    // bind to the select event.
    $(“#cmbProgramjqx”).bind(‘select’, function (event) {
    if (event.args) {
    var item = event.args.item;
    if (item) {
    var valueelement = $(“

    “);
    valueelement.html(“Value: ” + item.value);
    var labelelement = $(“

    “);
    labelelement.html(“Label: ” + item.label);

    // $(“#ProgramSelection”).children().remove();
    // $(“#ProgramSelection”).append(labelelement);
    // $(“#ProgramSelection”).append(valueelement);
    }
    }
    });
    $(“#cmbProgramjqx”).jqxComboBox({ selectedIndex: 0 });
    });

    // ************ Period drop down Selected Event ***********
    $(document).ready(function () {
    $(‘#ddlPeriodjqx’).bind(‘select’, function (event) {
    // Some code here.
    if (event.args) {
    var args = event.args;
    // select the item in the ‘select’ tag.
    var index = args.item.label;
    // alert(“Selected Item :” + index);
    // var items = $(“#ddlPeriodjqx”).jqxDropDownList(‘getItems’);
    // alert(“Total Item” + items.length)

    loadStreams();
    loadAdmissionMode();
    loadFeeComponentDetails()
    }

    });
    });
    // ************ Program Combo Selected Event ***********
    $(document).ready(function () {
    $(‘#cmbProgramjqx’).bind(‘select’, function (event) {

    var args = event.args;
    var item = $(‘#cmbProgramjqx’).jqxComboBox(‘getItem’, args.index);
    if (item != null) {
    //alert(“Selected Item :” + item.label);

    loadStreams();
    loadAdmissionMode();
    loadFeeComponentDetails()
    }
    });
    });

    // ************ Regulation(Stream) drop down Selected Event ***********
    $(document).ready(function () {
    $(‘#Regulationjqx’).bind(‘select’, function (event) {
    // Some code here.
    if (event.args) {
    var args = event.args;
    // select the item in the ‘select’ tag.
    var index = args.item.label;
    loadAdmissionMode();
    loadFeeComponentDetails()
    }
    });
    });

    //********* Period Drop Down list Load *************
    $(document).ready(function () {
    var theme = getTheme();

    // prepare the data
    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘PeriodID’ },
    { name: ‘Period’ },
    ]
    //,url: ‘AdmissionRequest.asmx/getRequestTypeJsonData’,
    //async: false
    };

    //var dataString = “fromDate: ” + fromDate + ” , toDate: ” + toDate;
    //Getting the source data with ajax GET request
    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getPeriodJD’,
    type: ‘GET’,
    dataType: ‘json’,
    data: “{}”,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    success: function (data) {
    source.localdata = data.d;
    },
    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dataAdapter = new $.jqx.dataAdapter(source);
    dataAdapter.dataBind();

    // Create a jqxDropDownList
    $(“#ddlPeriodjqx”).jqxDropDownList({ selectedIndex: 0,
    source: dataAdapter,
    displayMember: “Period”,
    valueMember: “PeriodID”,
    width: 250, height: 25, theme: theme
    });

    $(“#ddlPeriodjqx”).bind(‘select’, function (event) {
    if (event.args) {
    var item = event.args.item;
    if (item) {
    var valueelement = $(“

    “);
    valueelement.html(“Value: ” + item.value);
    var labelelement = $(“

    “);
    labelelement.html(“Label: ” + item.label);

    // $(“#PeriodSelection”).children().remove();
    // $(“#PeriodSelection”).append(labelelement);
    // $(“#PeriodSelection”).append(valueelement);
    }
    }
    });
    $(“#ddlPeriodjqx”).jqxDropDownList({ selectedIndex: 0 });
    });

    //**************** Load Request Type Drop Down List ****************************

    $(document).ready(function () {
    var theme = getTheme();

    // TempFromDate = new Date();
    // TempFromDate = $(‘#jqxWBatchDateAR’).jqxDateTimeInput(‘getDate’);

    // var fromDate = TempFromDate.format(“dd-MMM-yyyy”);
    // TempToDate = new Date();
    // TempToDate = $(‘#jqxWRequestDateAR’).jqxDateTimeInput(‘getDate’);
    // var toDate = TempToDate.format(“dd-MMM-yyyy”);

    // prepare the data
    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘RequestTypeID’ },
    { name: ‘RequestTypeName’ },
    ]
    //,url: ‘AdmissionRequest.asmx/getRequestTypeJsonData’,
    //async: false
    };

    //var dataString = “fromDate: ” + fromDate + ” , toDate: ” + toDate;
    //Getting the source data with ajax GET request
    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getRequestTypeJD’,
    type: ‘GET’,
    dataType: ‘json’,
    data: “{}”,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    // statusCode: {
    // 404: function() {
    // alert(‘page not found’);
    // },
    // 500: function() {
    // alert(‘server error’);
    // }
    // },
    success: function (data) {
    source.localdata = data.d;
    },
    // error: function (req,stat,err) {
    // alert(‘Req: ‘ + req + ‘ Status: ‘ + stat + ‘ ErrMsg: ‘ + err);
    // }

    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dataAdapter = new $.jqx.dataAdapter(source);
    dataAdapter.dataBind();

    // Create a jqxDropDownList
    $(“#ddlRequestTypejqx”).jqxDropDownList({ selectedIndex: 0,
    source: dataAdapter,
    displayMember: “RequestTypeName”,
    valueMember: “RequestTypeID”,
    width: 173, height: 25, theme: theme
    });

    $(“#ddlRequestTypejqx”).bind(‘select’, function (event) {
    if (event.args) {
    var item = event.args.item;
    if (item) {
    var valueelement = $(“

    “);
    valueelement.html(“Value: ” + item.value);
    var labelelement = $(“

    “);
    labelelement.html(“Label: ” + item.label);

    loadFeeComponentDetails()

    // $(“#RequestTypeSelection”).children().remove();
    // $(“#RequestTypeSelection”).append(labelelement);
    // $(“#RequestTypeSelection”).append(valueelement);
    }
    }
    });
    });
    //**************** End Load Request Type ****************************

    //**************** Load Centres ****************************
    $(document).ready(function () {
    var theme = getTheme();

    // prepare the data

    var dataAdapter = new $.jqx.dataAdapter(source);
    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘CentreID’ },
    { name: ‘CentreName’ },
    ]
    //,url: ‘AdmissionRequest.asmx/getRequestTypeJsonData’,
    //async: false
    };

    //var dataString = “fromDate: ” + fromDate + ” , toDate: ” + toDate;
    //Getting the source data with ajax GET request
    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getCentresJD’,
    type: ‘GET’,
    dataType: ‘json’,
    data: “{}”,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    success: function (data) {
    source.localdata = data.d;
    },
    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dataAdapter = new $.jqx.dataAdapter(source);
    dataAdapter.dataBind();

    // Create a jqxComboBox
    $(“#cmbCentrejqx”).jqxComboBox({ selectedIndex: 0, source: dataAdapter,
    displayMember: “CentreName”,
    valueMember: “CentreID”,
    width: 250, height: 25, theme: theme
    });

    // bind to the select event.
    $(“#cmbCentrejqx”).bind(‘select’, function (event) {
    if (event.args) {
    var item = event.args.item;
    if (item) {
    // var valueelement = $(“

    “);
    // valueelement.html(“Value: ” + item.value);
    // var labelelement = $(“

    “);
    // labelelement.html(“Label: ” + item.label);
    loadAdmissionMode();
    loadFeeComponentDetails()

    // $(“#CentreSelection”).children().remove();
    // $(“#CentreSelection”).append(labelelement);
    // $(“#CentreSelection”).append(valueelement);
    }
    }
    });
    });
    //**************** End Load Centres ****************************

    // bind to the select event.
    $(“#cmbCentrejqx”).bind(‘select’, function (event) {
    if (event.args) {
    var item = event.args.item;
    if (item) {
    loadAdmissionMode();
    loadFeeComponentDetails()
    }
    }
    });

    //**************** Load Streams ****************************
    $(document).ready(function () {
    //debugger
    var theme = getTheme();

    var RegulationProfile = {};
    var perioditems = $(“#ddlPeriodjqx”).jqxDropDownList(‘getItems’);
    var programItems = $(“#cmbProgramjqx”).jqxComboBox(‘getItems’);

    if (perioditems.length > 0) {
    var periodId = $(“#ddlPeriodjqx”).jqxDropDownList(‘getSelectedItem’);
    RegulationProfile.PeriodID = periodId.value;
    }
    else {
    RegulationProfile.PeriodID = -1;
    }

    if (programItems.length > 0) {
    var programId = $(“#cmbProgramjqx”).jqxComboBox(‘getSelectedItem’);
    RegulationProfile.ProgramID = programId.value;
    }
    else {
    RegulationProfile.ProgramID = -1;
    }

    RegulationProfile.StreamID = -1;
    // prepare the data
    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘StreamID’ },
    { name: ‘Streamname’ },
    ]
    };

    var strTest = JSON.stringify(RegulationProfile);
    //var dataString = “fromDate: ” + fromDate + ” , toDate: ” + toDate;
    //Getting the source data with ajax GET request
    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getRegulationJD’,
    type: ‘POST’,
    dataType: ‘json’,
    data: ‘{“RegulationProfile”:’ + JSON.stringify(RegulationProfile) + ‘}’,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    success: function (data) {
    source.localdata = data.d;
    },
    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dataAdapter = new $.jqx.dataAdapter(source);
    dataAdapter.dataBind();

    // Create a jqxDropDownList
    $(“#Regulationjqx”).jqxDropDownList({ selectedIndex: 0,
    source: dataAdapter,
    displayMember: “Streamname”,
    valueMember: “StreamID”,
    width: 173, height: 25, theme: theme
    });

    });

    //******************** End of Stream ******************************

    //**************** Load Admission Mode ****************************
    $(document).ready(function () {
    //debugger
    var theme = getTheme();

    var RegulationProfile = {};
    var perioditems = $(“#ddlPeriodjqx”).jqxDropDownList(‘getItems’);
    var programItems = $(“#cmbProgramjqx”).jqxComboBox(‘getItems’);
    var streamItems = $(“#Regulationjqx”).jqxDropDownList(‘getItems’);

    if (perioditems.length > 0) {
    var periodId = $(“#ddlPeriodjqx”).jqxDropDownList(‘getSelectedItem’);
    RegulationProfile.PeriodID = periodId.value;
    }
    else {
    RegulationProfile.PeriodID = -1;
    }

    if (programItems.length > 0) {
    var programId = $(“#cmbProgramjqx”).jqxComboBox(‘getSelectedItem’);
    RegulationProfile.ProgramID = programId.value;
    }
    else {
    RegulationProfile.ProgramID = -1;
    }

    if (streamItems.length > 0) {
    var streamId = $(“#Regulationjqx”).jqxDropDownList(‘getSelectedItem’);
    RegulationProfile.StreamID = streamId.value;
    }
    else {
    RegulationProfile.StreamID = -1;
    }
    // prepare the data
    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘AdmissionModeID’ },
    { name: ‘AdmissionModeName’ },
    ]
    };

    var strTest = JSON.stringify(RegulationProfile);
    //var dataString = “fromDate: ” + fromDate + ” , toDate: ” + toDate;
    //Getting the source data with ajax GET request
    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getAdmissionModeJD’,
    type: ‘POST’,
    dataType: ‘json’,
    data: ‘{“RegulationProfile”:’ + JSON.stringify(RegulationProfile) + ‘}’,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    success: function (data) {
    source.localdata = data.d;
    },
    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dataAdapter = new $.jqx.dataAdapter(source);
    dataAdapter.dataBind();

    // Create a jqxDropDownList
    $(“#ddlAdmissionModejqx”).jqxDropDownList({ selectedIndex: 0,
    source: dataAdapter,
    displayMember: “AdmissionModeName”,
    valueMember: “AdmissionModeID”,
    width: 173, height: 25, theme: theme
    });

    });
    //******************** End of Admission Mode ******************************

    function loadAdmissionMode() {

    var RegulationProfile = {};
    var perioditems = $(“#ddlPeriodjqx”).jqxDropDownList(‘getItems’);
    var programItems = $(“#cmbProgramjqx”).jqxComboBox(‘getItems’);
    var streamItems = $(“#Regulationjqx”).jqxDropDownList(‘getItems’);

    if (perioditems.length > 0) {
    var periodId = $(“#ddlPeriodjqx”).jqxDropDownList(‘getSelectedItem’);
    RegulationProfile.PeriodID = periodId.value;
    }
    else {
    RegulationProfile.PeriodID = -1;
    }

    if (programItems.length > 0) {
    var programId = $(“#cmbProgramjqx”).jqxComboBox(‘getSelectedItem’);
    RegulationProfile.ProgramID = programId.value;
    }
    else {
    RegulationProfile.ProgramID = -1;
    }

    if (streamItems.length > 0) {
    var streamId = $(“#Regulationjqx”).jqxDropDownList(‘getSelectedItem’);
    RegulationProfile.StreamID = streamId.value;
    }
    else {
    RegulationProfile.StreamID = -1;
    }
    // prepare the data
    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘AdmissionModeID’ },
    { name: ‘AdmissionModeName’ },
    ]
    };

    var strTest = JSON.stringify(RegulationProfile);
    //var dataString = “fromDate: ” + fromDate + ” , toDate: ” + toDate;
    //Getting the source data with ajax GET request
    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getAdmissionModeJD’,
    type: ‘POST’,
    dataType: ‘json’,
    data: ‘{“RegulationProfile”:’ + JSON.stringify(RegulationProfile) + ‘}’,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    success: function (data) {
    source.localdata = data.d;
    },
    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dataAdapter = new $.jqx.dataAdapter(source);
    dataAdapter.dataBind();

    $(“#ddlAdmissionModejqx”).jqxDropDownList({ selectedIndex: 0,
    source: dataAdapter
    });
    }

    function loadStreams() {
    var RegulationProfile = {};
    var perioditems = $(“#ddlPeriodjqx”).jqxDropDownList(‘getItems’);
    var programItems = $(“#cmbProgramjqx”).jqxComboBox(‘getItems’);

    if (perioditems.length > 0) {
    var periodId = $(“#ddlPeriodjqx”).jqxDropDownList(‘getSelectedItem’);
    RegulationProfile.PeriodID = periodId.value;
    }
    else {
    RegulationProfile.PeriodID = -1;
    }

    if (programItems.length > 0) {
    var programId = $(“#cmbProgramjqx”).jqxComboBox(‘getSelectedItem’);
    RegulationProfile.ProgramID = programId.value;
    }
    else {
    RegulationProfile.ProgramID = -1;
    }

    RegulationProfile.StreamID = -1;
    // prepare the data
    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘StreamID’ },
    { name: ‘Streamname’ },
    ]
    };

    var strTest = JSON.stringify(RegulationProfile);
    //var dataString = “fromDate: ” + fromDate + ” , toDate: ” + toDate;
    //Getting the source data with ajax GET request
    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getRegulationJD’,
    type: ‘POST’,
    dataType: ‘json’,
    data: ‘{“RegulationProfile”:’ + JSON.stringify(RegulationProfile) + ‘}’,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    success: function (data) {
    source.localdata = data.d;
    },
    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dataAdapter = new $.jqx.dataAdapter(source);
    dataAdapter.dataBind();
    $(“#Regulationjqx”).jqxDropDownList({ selectedIndex: 0,
    source: dataAdapter
    });
    }

    $(document).ready(function () {
    //debugger
    var theme = getTheme();

    var Batchprofile = {};

    var perioditems = $(“#ddlPeriodjqx”).jqxDropDownList(‘getItems’);
    var programItems = $(“#cmbProgramjqx”).jqxComboBox(‘getItems’);
    var streamItems = $(“#Regulationjqx”).jqxDropDownList(‘getItems’);
    var centreItems = $(“#cmbCentrejqx”).jqxComboBox(‘getItems’);
    var ReqTypeItems = $(“#ddlRequestTypejqx”).jqxDropDownList(‘getItems’);
    if (perioditems.length > 0) {
    var periodId = $(“#ddlPeriodjqx”).jqxDropDownList(‘getSelectedItem’);
    Batchprofile.PeriodID = periodId.value;
    }
    else {
    Batchprofile.PeriodID = -1;
    }

    if (programItems.length > 0) {
    var programId = $(“#cmbProgramjqx”).jqxComboBox(‘getSelectedItem’);
    Batchprofile.ProgramID = programId.value;
    }
    else {
    Batchprofile.ProgramID = 0;
    }

    if (streamItems.length > 0) {
    var streamId = $(“#Regulationjqx”).jqxDropDownList(‘getSelectedItem’);
    Batchprofile.StreamID = streamId.value;
    }
    else {
    Batchprofile.StreamID = -1;
    }

    if (ReqTypeItems.length > 0) {
    var requestId = $(“#ddlRequestTypejqx”).jqxDropDownList(‘getSelectedItem’);
    Batchprofile.RequestID = requestId.value;
    }
    else {
    Batchprofile.RequestID = -1;
    }

    if (centreItems.length > 0) {
    var centreId = $(“#cmbCentrejqx”).jqxComboBox(‘getSelectedItem’);
    Batchprofile.CentreID = centreId.value;
    }
    else {
    Batchprofile.CentreID = -1;
    }

    Batchprofile.StudentID = -1;
    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘Selection’ },
    { name: ‘ID’,type: ‘int’ },
    { name: ‘FeeComponentName’ },
    { name: ‘Amount’ },
    { name: ‘Quantity’, type: ‘int’ },
    { name: ‘PaidAmout’, type: ‘int’ }
    ],
    updaterow: function (rowid, rowdata, commit) {
    // synchronize with the server – send update command
    // call commit with parameter true if the synchronization with the server is successful
    // and with parameter false if the synchronization failder.
    commit(true);
    }
    };

    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getFeeComponentsJD’,
    type: ‘POST’,
    dataType: ‘json’,
    data: ‘{“Batchprofile”:’ + JSON.stringify(Batchprofile) + ‘}’,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    success: function (data) {
    source.localdata = data.d;
    },
    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dataAdapter = new $.jqx.dataAdapter(source);

    // initialize jqxGrid
    $(“#RequestCompGrid”).jqxGrid(
    {
    width: 680,
    source: dataAdapter,
    editable: true,
    theme: theme,
    selectionmode: ‘singlecell’,
    columns: [
    { text: ‘Select’, datafield: ‘Selection’, columntype: ‘checkbox’, width: 67,

    renderer: function () {
    return ‘

    ‘;
    },
    rendered: function (element) {
    $(element).jqxCheckBox({ theme: theme, width: 16, height: 16, animationShowDelay: 0, animationHideDelay: 0 });
    columnCheckBox = $(element);
    $(element).bind(‘change’, function (event) {
    var checked = event.args.checked;
    if (checked == null || updatingCheckState) return;
    var rowscount = $(“#RequestCompGrid”).jqxGrid(‘getdatainformation’).rowscount;
    $(“#RequestCompGrid”).jqxGrid(‘beginupdate’);

    if (checked) {
    $(“#RequestCompGrid”).jqxGrid(‘selectallrows’);
    }
    else if (checked == false) {
    $(“#RequestCompGrid”).jqxGrid(‘clearselection’);
    }

    for (var i = 0; i 0) {
    $(columnCheckBox).jqxCheckBox(‘indeterminate’);
    }
    else {
    $(columnCheckBox).jqxCheckBox(‘uncheck’);
    }
    updatingCheckState = false;
    }
    });

    });

    // var rowEdit = function (row) {
    // //if (row == 0)
    // return false;
    // }

    // select or unselect rows when the checkbox is checked or unchecked.
    $(“#RequestCompGrid”).bind(‘cellendedit’, function (event) {

    if (event.args.value) {
    $(“#RequestCompGrid”).jqxGrid(‘selectrow’, event.args.rowindex);
    }
    else {
    $(“#RequestCompGrid”).jqxGrid(‘unselectrow’, event.args.rowindex);
    }
    });

    function loadFeeComponentDetails() {
    $(document).ready(function () {
    //debugger
    var theme = getTheme();

    var Batchprofile = {};

    var perioditems = $(“#ddlPeriodjqx”).jqxDropDownList(‘getItems’);
    var programItems = $(“#cmbProgramjqx”).jqxComboBox(‘getItems’);
    var streamItems = $(“#Regulationjqx”).jqxDropDownList(‘getItems’);
    var centreItems = $(“#cmbCentrejqx”).jqxComboBox(‘getItems’);
    var ReqTypeItems = $(“#ddlRequestTypejqx”).jqxDropDownList(‘getItems’);
    if (perioditems.length > 0) {
    var periodId = $(“#ddlPeriodjqx”).jqxDropDownList(‘getSelectedItem’);
    Batchprofile.PeriodID = periodId.value;
    }
    else {
    Batchprofile.PeriodID = -1;
    }

    if (programItems.length > 0) {
    var programId = $(“#cmbProgramjqx”).jqxComboBox(‘getSelectedItem’);
    Batchprofile.ProgramID = programId.value;
    }
    else {
    Batchprofile.ProgramID = 0;
    }

    if (streamItems.length > 0) {
    var streamId = $(“#Regulationjqx”).jqxDropDownList(‘getSelectedItem’);
    Batchprofile.StreamID = streamId.value;
    }
    else {
    Batchprofile.StreamID = -1;
    }

    Batchprofile.RequestID = -1;

    if (centreItems.length > 0) {
    var centreId = $(“#cmbCentrejqx”).jqxComboBox(‘getSelectedItem’);
    Batchprofile.CentreID = centreId.value;
    }
    else {
    Batchprofile.CentreID = -1;
    }

    if (ReqTypeItems.length > 0) {
    var requestTypeId = $(“#ddlRequestTypejqx”).jqxDropDownList(‘getSelectedItem’);
    Batchprofile.RequestTypeID = requestTypeId.value;
    }
    else {
    Batchprofile.RequestTypeID = -1;
    }
    Batchprofile.StudentID = -1;

    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘Selection’ },
    { name: ‘ID’, type: ‘int’ },
    { name: ‘FeeComponentName’ },
    { name: ‘Amount’, type: ‘float’ },
    { name: ‘Quantity’, type: ‘int’ },
    { name: ‘PaidAmout’, type: ‘int’ }
    ],
    updaterow: function (rowid, rowdata, commit) {
    // synchronize with the server – send update command
    // call commit with parameter true if the synchronization with the server is successful
    // and with parameter false if the synchronization failder.
    commit(true);
    }
    };
    //var strTest = ‘{“Batchprofile”:’ + JSON.stringify(Batchprofile) + ‘}’;
    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getFeeComponentsJD’,
    type: ‘POST’,
    dataType: ‘json’,
    data: ‘{“Batchprofile”:’ + JSON.stringify(Batchprofile) + ‘}’,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    success: function (data) {
    source.localdata = data.d;
    },
    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dataAdapter = new $.jqx.dataAdapter(source);

    // initialize jqxGrid
    $(“#RequestCompGrid”).jqxGrid(
    {
    source: dataAdapter
    });

    });
    }

    //**************************** Create Draft Details Grid *****************
    $(document).ready(function () {
    //debugger
    var theme = getTheme();

    var Batchprofile = {};

    var generaterow = function (i) {
    var row = {};

    row[“PayMode”] = “”;
    row[“DDChequeNo”] = “”;
    row[“DDDate”] = new Date;
    row[“BankName”] = “”;
    row[“InFavour”] = “”;
    row[“Amount”] = 0;
    row[“SeqNo”] = 0;
    return row;
    }

    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘PayMode’ },
    { name: ‘DDChequeNo’ },
    { name: ‘DDDate’ },
    { name: ‘BankName’ },
    { name: ‘InFavour’ },
    { name: ‘Amount’ },
    { name: ‘SeqNo’ }
    ],
    updaterow: function (rowid, rowdata, commit) {
    // synchronize with the server – send update command
    // call commit with parameter true if the synchronization with the server is successful
    // and with parameter false if the synchronization failder.
    commit(true);
    }
    };

    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getFeeComponentsJD’,
    type: ‘POST’,
    dataType: ‘json’,
    data: ‘{“Batchprofile”:’ + JSON.stringify(Batchprofile) + ‘}’,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    success: function (data) {
    source.localdata = data.d;
    },
    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dataAdapter = new $.jqx.dataAdapter(source);

    // initialize jqxGrid
    $(“#gvDDDetailsjqx”).jqxGrid(
    {
    width: 680,
    source: dataAdapter,
    editable: true,
    //theme: theme,
    selectionmode: ‘singlecell’,
    editmode: ‘click’,
    columns: [
    { text: ‘Pay Mode’, datafield: ‘PayMode’, columntype: ‘dropdownlist’, width: 67,
    createeditor: function (row, cellvalue, editor) {
    editor.jqxDropDownList({ displayMember: ‘PayMode’,
    valueMember: ‘PayModeID’, source: loadGridDropDownList(‘PayMode’, ‘PayModeID’, ‘PaymentMode’)
    });
    // editor.bind(‘select’, function (event) {
    // var selectedIndex = event.args.index;
    // var value = $(‘#gvDDDetailsjqx’).jqxGrid(‘getcellvalue’, selectedIndex, “PayMode”)
    // alert(“Selected Index” + selectedIndex + ” value ” +value);

    // });
    }

    },
    { text: ‘DD/ChequeNo’, datafield: ‘DDChequeNo’, columntype: ‘textbox’, width: 120 },
    { text: ‘DD Date’, datafield: ‘DDDate’, columntype: ‘datetimeinput’, width: 100,
    cellsalign: ‘right’, cellsformat: ‘d’,
    validation: function (cell, value) {
    var year = value.getFullYear();
    if (year >= 2013) {
    return { result: false, message: “Draft/Cheque Date should be before 1/1/2013” };
    }
    return true;
    }

    },
    { text: ‘Bank Name’, datafield: ‘BankName’, columntype: ‘dropdownlist’, width: 150,
    createeditor: function (row, cellvalue, editor) {
    editor.jqxDropDownList({ displayMember: ‘BankName’,
    valueMember: ‘BankID’, source: loadGridDropDownList(‘BankName’, ‘BankID’, ‘Bank’)
    });
    }

    },
    { text: ‘InFavour’, datafield: ‘InFavour’, columntype: ‘dropdownlist’, width: 150,
    createeditor: function (row, cellvalue, editor) {
    editor.jqxDropDownList({ displayMember: ‘FavourType’,
    valueMember: ‘FavourID’, source: loadGridDropDownList(‘FavourType’, ‘FavourID’, ‘InFavour’)
    });
    }

    },
    { text: ‘Amount’, datafield: ‘Amount’, columntype: ‘numberinput’, width: 80, cellsalign: ‘right’,
    validation: function (cell, value) {
    if (value 0) {
    var periodId = $(“#ddlPeriodjqx”).jqxDropDownList(‘getSelectedItem’);
    Batchprofile.PeriodID = periodId.value;
    }
    else {
    Batchprofile.PeriodID = -1;
    }
    if ($(“#hdnBatchID”).value == null) {
    Batchprofile.BatchID = -1
    }
    else {
    Batchprofile.BatchID = $(“#hdnBatchID”).value;
    }

    // prepare the data
    var dropDownListSource =
    {
    datatype: “json”,
    datafields: [
    { name: dField },
    { name: vField }
    ]
    };
    var TableName = tableName;
    var strTest = ‘”Batchprofile”:’ + JSON.stringify(Batchprofile) + ‘,’ + ‘”tableName”:’ + JSON.stringify(TableName);

    $.ajax({
    url: locationUrl + ‘/AdmissionRequest.asmx/getDraftDetails’,
    type: ‘POST’,
    dataType: ‘json’,
    data: ‘{‘ + strTest +’}’,
    async: false,
    cache: false,
    contentType: ‘application/json; charset=utf-8’,
    success: function (data) {
    dropDownListSource.localdata = data.d;
    },
    error: function (xhr, status, error) {
    alert(JSON.stringify(xhr));
    }
    });

    var dropdownListAdapter = new $.jqx.dataAdapter(dropDownListSource, { autoBind: true, async: false });

    return dropdownListAdapter;
    }

    //**************************** End of Draft Details Grid *****************
    function addrowbutton_onclick() {
    document.getElementById(‘cancelrowbutton’).style.visibility = “visible”;
    document.getElementById(‘updaterowbutton’).style.visibility = “visible”;
    }

    function cancelrowbutton_onclick() {
    document.getElementById(‘cancelrowbutton’).style.visibility = “hidden”;
    document.getElementById(‘updaterowbutton’).style.visibility = “hidden”;
    }

    function updaterowbutton_onclick() {
    document.getElementById(‘cancelrowbutton’).style.visibility = “hidden”;
    document.getElementById(‘updaterowbutton’).style.visibility = “hidden”;
    }

    $(document).ready(function () {
    // Save Button Click Event.
    $(“#btnSaveDetails”).bind(‘click’, function () {
    //debugger
    var BatchProcessingProfile = {};
    var perioditems = $(“#ddlPeriodjqx”).jqxDropDownList(‘getItems’);
    var programItems = $(“#cmbProgramjqx”).jqxComboBox(‘getItems’);
    var streamItems = $(“#Regulationjqx”).jqxDropDownList(‘getItems’);
    var centreItems = $(“#cmbCentrejqx”).jqxComboBox(‘getItems’);
    var ReqTypeItems = $(“#ddlRequestTypejqx”).jqxDropDownList(‘getItems’);

    if (perioditems.length > 0) {
    var periodId = $(“#ddlPeriodjqx”).jqxDropDownList(‘getSelectedItem’);
    BatchProcessingProfile.PeriodID = periodId.value;
    }
    else {
    $(“#imgSuccess”).Visible = true;
    $(“#imgSuccess”).ImageUrl = “~/App_Themes/AUT/Images/icon_warning.gif”;

    }

    if (programItems.length > 0) {
    var programId = $(“#cmbProgramjqx”).jqxComboBox(‘getSelectedItem’);
    BatchProcessingProfile.ProgramID = programId.value;
    }
    else {
    BatchProcessingProfile.ProgramID = 0;
    }

    if (streamItems.length > 0) {
    var streamId = $(“#Regulationjqx”).jqxDropDownList(‘getSelectedItem’);
    BatchProcessingProfile.StreamID = streamId.value;
    }
    else {
    BatchProcessingProfile.StreamID = -1;
    }

    BatchProcessingProfile.RequestID = -1;

    if (centreItems.length > 0) {
    var centreId = $(“#cmbCentrejqx”).jqxComboBox(‘getSelectedItem’);
    if (centreId.value > 0) {
    BatchProcessingProfile.CentreID = centreId.value;
    }
    else {
    alert(“Please Select a Centre”);
    }
    }
    else {
    $(“#imgSuccess”).Visible = true;
    $(“#imgSuccess”).ImageUrl = “~/App_Themes/AUT/Images/icon_warning.gif”;

    }

    if (ReqTypeItems.length > 0) {
    var requestTypeId = $(“#ddlRequestTypejqx”).jqxDropDownList(‘getSelectedItem’);
    BatchProcessingProfile.RequestTypeID = requestTypeId.value;
    }
    else {
    BatchProcessingProfile.RequestTypeID = -1;
    }
    BatchProcessingProfile.StudentID = -1;

    var Draftdata = $(“#RequestCompGrid”).jqxGrid(‘exportdata’, ‘xml’);
    alert(JSON.stringify(Draftdata));

    });
    });

    p { color:red; }
    .displayText
    {
    color: Blue;
    font-family: Arial,Tahoma,Verdana,Helvetica,sans-serif;
    font-size: 11px;
    font-weight: normal;
    }
    .displayText
    {
    color: Blue;
    font-family: Arial,Tahoma,Verdana,Helvetica,sans-serif;
    font-size: 11px;
    font-weight: normal;
    }
    .displayText
    {
    color: Blue;
    font-family: Arial,Tahoma,Verdana,Helvetica,sans-serif;
    font-size: 11px;
    font-weight: normal;
    }
    #txtApplicantName
    {
    width: 252px;
    }
    #txtApplicationNo
    {
    width: 246px;
    }

    Batch Date

    Period

    Request Date

    Application Number

    Request Type

    Applicant Name

    Regulation

    Course

    Admission Mode

    Centre Name

    Prospectus Bill No

    No Records to Display

    <asp:CheckBox ID="chkSelect1" runat="server" Checked='’ onclick=”CheckOne(this);” />

    <asp:TextBox ID="txtAmount" runat="server" Text='’ Style=”text-align: right;
    border: 0px; font-size: xx-Medium; display:none;” contentEditable=”false” Width=”100px” BackColor=”Transparent” />
    <asp:Label ID="TextBox1" runat="server" Text='’ Width=”100px” Style=”text-align: right;” />

             

    No Records to Display

    <asp:Label ID="lblPaymentMode" runat="server" Text='’
    Width=”80px” />

    <asp:TextBox ID="txtDDChequeNo" runat="server" MaxLength="10" Text='’
    Width=”80px” onkeypress=”return checkNum(this);” />

    <asp:Label ID="lblDDChequeNo" runat="server" Text='’
    Width=”80px” />

    <asp:TextBox ID="txtDDDate" runat="server" Text='’
    Width=”80px”>

    <asp:Label ID="lblDDDate" runat="server" Text='’
    Width=”80px” />

    <asp:Label ID="lblBank" runat="server" Text='’ />
    <asp:Label ID="lblBankBranch" runat="server" Text='’
    Style=”display: none;” />

    <asp:Label ID="lblInFavour" runat="server" Text='’ />

    <asp:TextBox ID="txtAmount0" runat="server" MaxLength="12" Text='’
    Width=”50px” onkeypress=”return DecimalValidate(event);”
    Style=”text-align: right;” />

    <asp:Label ID="lblAmount" runat="server" Text='’ />

    <asp:Label ID="lblSeqNo" runat="server" Text='’ />

    $(document).ready(function () {
    // create jqxCheckBox.
    $(“#jqxcheckbox”).jqxCheckBox({ width: 120, height: 25 });
    // bind to change event.
    $(“#jqxcheckbox”).bind(‘change’, function (event) {
    var checked = event.args.checked;
    $(‘#log’).html(‘checked: ‘ + checked);
    });
    });

    Click me

    Peter Stoev
    Keymaster

    Sorry, but we won’t be able to run that code and it does not help us much. We needed a small sample only with JS + HTML which reproduces the erroneous behavior. We will test a scenario where in cellendedit, we set dynamically the editable property of the other columns in the Grid. If that reproduces the issue, we will create a work item about it and will resolve it in a future version.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    hi

    thanks

    $(document).ready(function () {

    $(“#gvDDDetailsjqx”).bind(‘cellendedit’, function (event) {
    //debugger
    var args = event.args;
    $(“#divGridDDEndEditEvent”).html(“Event Type: cellendedit, Column: ” + args.datafield + “, Row: ” + (1 + args.rowindex) + “, Value: ” + args.value);
    if (event.args.datafield = ‘PayMode’ && args.value == ‘Cash’) {

    $(“#gvDDDetailsjqx”).jqxGrid(‘setcolumnproperty’, ‘DDChequeNo’, ‘editable’, false);
    //$(“#gvDDDetailsjqx”).jqxGrid(‘setcolumnproperty’, ‘DDDate’, ‘editable’, false);
    //$(“#gvDDDetailsjqx”).jqxGrid(‘setcolumnproperty’, ‘BankName’, ‘editable’, false);
    //$(“#gvDDDetailsjqx”).jqxGrid(‘setcolumnproperty’, ‘InFavour’, ‘editable’, false);
    }
    });

    });

    when I set one columns property to editable false. It works fine. but If I use it for more than one column It throws error. It stops at
    {if(!C.isNestedGrid){D.focus()} in jqxgrid.edit.js.

    will it help you?

    Ramesh Gurunathan.

    Hi

    Can you please tell me how to set cell editable either true or false programmatically?

    Thanks & regards
    Ramesh Gurunathan


    Peter Stoev
    Keymaster

    Hi Ramesh,

    The following example shows how to disable the editing of rows/cells: disableeditingofrows.htm.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.