jQWidgets Forums

jQuery UI Widgets Forums Grid server request going two times

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • server request going two times #13617

    vijaybabu
    Participant

    Server request going two times when i submit/ reset the button and some alert message is coming when i click submit/reset button

    Alert Message :

    The data is still loading. When the data binding is completed, the Grid raises the ‘bindingcomplete’ event. Call this function in the ‘bindingcomplete’ event handler.

    http://maniyanshaiclub.com/forum/vijay/upload/photo/2ta.jpg

    Please give me the solution ASAP

    jQuery('#reset').click(function(){
    $('#email').attr('value','');
    $('#firstName').attr('value','');
    $('#secondName').attr('value','');
    $('#company').attr('value','');
    getlists('','');
    //jQuery("#list2").trigger("reloadGrid");
    });

    function getlists(searchString,searchValue){

    var list_id=document.getElementById(‘list’).value;
    var theme = getTheme();
    var id_user = document.getElementById(‘group_list’).value;
    if(document.getElementById(‘group_list’).value==0){
    list_id=0;
    }

    $(“#gridFinder”).css({
    ‘width’:sWidth,
    ‘display’:’block’
    });
    var theme=’ui-redmond’;

    var source =
    {
    datatype: “json”,
    async:true,
    datafields: [{name:’id’},{name:’firstname’},{name:’secondname’},{name:’gender’},{name:’company’},{name:’email1′},{name:’comment’},{name:’phone’},{name:’mobile’},{name:’address_street’},{name:’address_city’},{name:’address_state’},{name:’address_country’},{name:’address_zip’},{name:’title’},{name:’department’},{name:’industry’},{name:’date’},{name:’last_updated_date’},{name:’email_owner_name’},{name:’email_owner_emailid’}, {name:’source’}, {name:’listname’}, {name: ‘list_type’}],
    url:’index.php?module=Users&action=managesubs’,
    data: {
    id_user:id_user,
    list_id_selected:list_id,
    extrafield:1,
    search_oper:’cn’,
    searchField:searchString,
    searchString:searchValue
    },
    id:’id’,
    beforeprocessing: function(data)
    {
    source.totalrecords = data.TotalRows;
    },
    sort: function()
    {
    // update the grid and send a request to the server.
    $(“#list2”).jqxGrid(‘updatebounddata’);
    },
    root: ‘Rows’,

    };
    var dataAdapter = new jQuery.jqx.dataAdapter(source);
    var initrowdetails = function (index, parentElement, gridElement) {
    var row = index;;
    var id = $(“#list2”).jqxGrid(‘getrowdata’, row)[‘id’];
    var grid = $($(parentElement).children()[0]);

    var subsource =
    {
    url: ‘index.php?module=Users&action=getSentScheduledCampaignList’,
    dataType: ‘json’,
    data: {emailID: ‘aaa1@gmail.com’},
    datatype: “json”,
    cache: false,
    datafields: [
    { name: ‘miscfields’ }
    ],
    root: ‘Rows’
    };
    var adapter = new $.jqx.dataAdapter(subsource);
    // init Sub grid
    grid.jqxGrid(
    {
    virtualmode: true,
    autoheight: true,
    width: 800,
    rowsheight : 100,
    //sortable: true,
    //pageable: true,
    //pagesize: 5,
    source: adapter,
    theme: ‘ui-redmond’,
    rendergridrows: function (obj) {
    return obj.data;
    },
    columns: [
    { text: ‘Sent and Scheduled Details’, datafield: ‘miscfields’, width: 800,height:200 }
    ]
    });
    };

    // set rows details.
    $(“#list2”).bind(‘bindingcomplete’, function (event) {
    if (event.target.id == “list2”) {
    $(“#list2”).jqxGrid(‘beginupdate’);
    var datainformation = $(“#list2”).jqxGrid(‘getdatainformation’);
    for (i = 0; i < datainformation.rowscount; i++) {

    var url = "index.php?module=Users&action=getSentScheduledCampaignList";
    $("#list2").jqxGrid('setrowdetails', i, "

    “, 200, true);
    }
    $(“#list2”).jqxGrid(‘resumeupdate’);
    }
    });

    jQuery(“#list2”).jqxGrid({
    width:’100%’,
    source: dataAdapter,
    pageable:true,
    virtualmode: true,
    selectionmode: ‘singlecell’,
    theme:’ui-redmond’,
    // showfilterrow: true,
    sortable:true,
    autoheight: true,
    mtype:’POST’,
    // rowdetails: true,
    // rowdetailstemplate: { rowdetails: “

    “, rowdetailsheight: 200 },
    columnsresize:true,
    pagesizeoptions: [’10’, ’20’, ’30’],
    columnsreorder: true,
    rowdetails: true,
    initrowdetails: initrowdetails,
    ready: function(){
    $(“#list2”).bind(‘cellselect’, function (event) {
    selectedrow = event.args.rowindex;
    actionItemsProp();
    });
    },
    rendergridrows: function()
    {
    return dataAdapter.records;
    },
    columns:[
    { text: ‘Action’, datafield: ‘id’, columntype: ‘image’, width:30 ,cellsalign: ‘right’, cellsrenderer:
    function (cellValue, options, rowObject) {
    return ‘ ‘;
    },
    },
    {text:’First name’,datafield:’firstname’, resizable: true, minwidth:90},
    {text:’Second name’,datafield:’secondname’, resizable: true, minwidth:80},
    {text:’Gender’,datafield:’gender’, resizable: true, minwidth:80},
    {text:’Company’,datafield:’company’, resizable: true, minwidth:80},
    {text:’Email ID’,datafield:’email1′, resizable: true, minwidth:180},
    {text:’Comment’,datafield:’comment’, resizable: true, minwidth:80},
    {text:’Phone’,datafield:’phone’, resizable: true, minwidth:80},
    {text:’Mobile’,datafield:’mobile’, resizable: true, minwidth:80},
    {text:’Street Address’,datafield:’address_street’, resizable: true, minwidth:80},
    {text:’City’,datafield:’address_city’,resizable: true, minwidth:80},
    {text:’State’,datafield:’address_state’,resizable: true, minwidth:80},
    {text:’Country’,datafield:’address_country’, resizable: true, minwidth:80},
    {text:’Postal code’,datafield:’address_zip’,resizable: true, minwidth:80},
    {text:’Title’,datafield:’title’,resizable: true, minwidth:80},
    {text:’Department’, datafield:’department’,resizable: true, minwidth:80},
    {text:’Industry’,datafield:’industry’,resizable: true, minwidth:80},
    {text:’Created’,datafield:’date’, minwidth:80, resizable: true},
    {text:’Updated’,datafield:’last_updated_date’, minwidth:80,resizable: true},
    {text:’Owner name’,datafield:’email_owner_name’, resizable: true, minwidth:80},
    {text:’Owner Email’,datafield:’email_owner_emailid’,filterable: false, resizable: true, minwidth:80},
    {text:’Source’, minwidth:80, datafield:’source’},
    {text:’Subscribed List’, minwidth:80, datafield:’listname’},
    {text:’List Type’, datafield:’list_type’, minwidth:80}]
    });

    }

    server request going two times #13619

    Peter Stoev
    Keymaster

    Hi vijaybabu,

    For Server processing with Nested Grids, please take a look at the Nested Grids sample in the “phpdemos” folder provided with the product download. In addition, make sure that you use jQWidgets 2.6.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.