jQWidgets Forums

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: JQGrid Referesh JQGrid Referesh #24923

    chaitaniya
    Member

    Hi Dimitar,

    I am using JQX grid in the AJAX call, which is in the Submit click function.

    The problem is, I am able to get the data for the first submit click, but not from the next submit clicks.The page has got struck.
    I think there is a refreshing problem.Please give me a solution for this problem.And here is my Code:

    function submit() {

    var str = “”;
    jQuery(“#grid”).jqxGrid(‘destroy’);
    jQuery(“#grid”).jqxGrid(‘reload’);
    jQuery(“#grid”).jqxGrid(‘refreshdata’);

    jQuery(“#grid”).jqxGrid(‘refresh’);

    var fc = new Array();
    fc.push(jQuery(“#DataInput”).val());
    fc.push(jQuery(“#Quarter”).val());
    fc.push(jQuery(“#Quarter1”).val());
    fc.push(jQuery(“#Version”).val());
    fc.push(jQuery(“#Version1”).val());
    fc.push(jQuery(“#Year”).val());
    fc.push(jQuery(“#Year1”).val());

    var PrintSource = new Array();

    PrintSource.push(vid1);
    PrintSource.push(jQuery(“#Year”).val());
    PrintSource.push(jQuery(“#Quarter”).val());

    var PrintTarget = new Array();

    PrintTarget.push(vid2);
    PrintTarget.push(jQuery(“#Year1”).val());
    PrintTarget.push(jQuery(“#Quarter1”).val());

    jQuery(“#ProductlistboxCommon option”).attr(“selected”, “selected”);
    var fcr = new Array();
    fcr.push(jQuery(“#Region”).val());
    var ProductlistboxCommon2 = new Array();
    for (var i = 0; i < jQuery("#ProductlistboxCommon").multiselect("getChecked").length; i++) {
    var productid = jQuery("#ProductlistboxCommon").multiselect("getChecked")[i].value;

    ProductlistboxCommon2.push(productid.substring(0, productid.indexOf(':')));

    }

    jQuery("#Productlistboxone option").attr("selected", "selected");
    var Productlistboxtwo = new Array();
    for (var i = 0; i < jQuery("#Productlistboxone").multiselect("getChecked").length; i++) {
    Productlistboxtwo.push(jQuery("#Productlistboxone").multiselect("getChecked")[i].value);
    }

    jQuery.ajax({
    dataType: 'json',

    beforeSend: function () {
    jQuery('#loading').show();
    },

    url: 'GetCompareData',
    data: { submit: 'Compare', fc: JSON.stringify(fc), columnsList: JSON.stringify(Productlistboxtwo), fcr: JSON.stringify(fcr), fcp: JSON.stringify(ProductlistboxCommon2), PrintSource: JSON.stringify(PrintSource), PrintTarget: JSON.stringify(PrintTarget) },
    success: function (result) {

    var columnSchema = [];

    for (var i = 0; i < jQuery("#Productlistboxone").multiselect("getChecked").length; i++) {
    var name = jQuery("#Productlistboxone").multiselect("getChecked")[i].value
    var alias_name = jQuery("#Productlistboxone [value=" + name + "]").text();
    columnSchema.push({ text: 'alias_name', datafield: 'name', minwidth: 150, filtertype: true, pinned: true, editable: false });
    // columnVal += "{ text: '" + ec.aum_entity_column_alias_name.Replace("'", "\\'") + "', datafield: '" + ec.aum_entity_column_name + "', minwidth: 150,filtertype: '" + ec.aum_entity_column_filtertype + "', pinned: " + ec.aum_entity_column_pinned.ToString().ToLower() + ", cellsrenderer: validRenderer,align:'center' },\n";
    }
    alert(JSON.stringify(columnSchema));
    var theme = 'classic';

    var gridData = result;
    var source =
    {
    async: false,
    localdata: gridData,
    datatype: 'json'
    };
    var dataAdapter = new jQuery.jqx.dataAdapter(source);

    jQuery("#grid").jqxGrid('updatebounddata');

    jQuery("#grid").jqxGrid(
    {
    width: '100%',
    source: dataAdapter,
    theme: theme,
    columnsheight: 50,
    scrollmode: 'logical',
    pageable: true,
    pagesize: 25,
    altrows: true,
    clear: true,
    pagesizeoptions: ['25', '50', '75'],
    autoheight: false,
    showfilterrow: true,
    filterable: true,
    sortable: true,
    cache: true,
    async: false,
    selectionmode: 'singlerow',
    setcolumnalign: 'center',
    columnsresize: true,
    columnsreorder: true,
    autoresizecolumns: true,

    horizontalscrollbarlargestep: 150,
    columns: [{ text: 'asset code', datafield: 'aum_asset_code', minwidth: 150, filtertype: true, pinned: true, editable: false },
    { text: 'asset name', datafield: 'aum_asset_name', minwidth: 150, filtertype: true, pinned: true, editable: false },
    { text: 'Master Entity Code', datafield: 'aum_asset_product_code', minwidth: 150, filtertype: true, pinned: true, editable: false },
    { text: 'product name', datafield: 'aum_asset_product_name', minwidth: 150, filtertype: true, pinned: true, editable: false}]

    });

    jQuery("#compare_result").show();
    jQuery('#loading').hide();
    jQuery('#comparepanel').collapsible('close');
    jQuery('#compare_result').collapsible('open');
    jQuery("#grid").show();

    }
    });
    }

Viewing 1 post (of 1 total)