jQuery UI Widgets Forums Grid Ajax load on details column

This topic contains 5 replies, has 2 voices, and was last updated by  JmiXIII 12 years, 7 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Ajax load on details column #3661

    JmiXIII
    Member

    Hello,

    I can achieve static column details without pb.
    I would like to load the details when expanding the column but it seems there is no option implemented in the API.
    Here is my static view coded with web2py :


    {{extend 'layout.html'}}

    $(document).ready(function () {
    var data = {"Products": {{=XML(liste)}} }; // Json passed statically ~1500 to 10000 lines, no need for remote at the moment

    var source =
    {
    localdata: data,
    datatype: "json",
    root: 'Products'
    };

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

    $("#jqxgrid").jqxGrid(
    {
    width : 1000,
    height : 500,
    source: dataAdapter,
    columnsresize: true,
    pageable: false,
    autoheight: false,
    sortable: true,
    filterable: true,
    enabletooltips: true,
    groupable: false,
    altrows: false,
    columnsresize: true,
    selectionmode: 'multiplecellsextended',
    columnsmenuwidth: 20,
    rowdetails: true,
    //initrowdetails: initrowdetails,
    pagesizeoptions: ['10', '20', '50'],
    columns: [
    {{for field in db.NC.fields[1:]:}}
    { text: '{{=field}}', dataField: '{{=field}}' ,width: 100 },
    {{pass}}
    { text: 'link', dataField: 'link' ,width: 100 },

    ],
    });

    //set row => here LOAD ajax function is performed on all lines when loading the page
    $("#jqxgrid").jqxGrid('beginupdate');
    {{for row in liste1:}}
    $("#jqxgrid").jqxGrid('setrowdetails', {{=row.NC_Num}},"

    {{=LOAD('nc','form.load',args='1', ajax=True)}}

    ", 200, true);
    {{pass}}
    $("#jqxgrid").jqxGrid('resumeupdate');

    });

    The {{=LOAD(…)}} component is rendered as follows:


    loading...

    But the code above is evaluated immediately after the page is rendered. Do you know I could avluated it after examples ?
    If no can you show an ajax load example when expanding a row ?

    Best regards

    Ajax load on details column #3662

    JmiXIII
    Member

    The {{=LOAD(…)}} component is rendered as follows:


    loading...

    Ajax load on details column #3663

    JmiXIII
    Member

    The {{=LOAD(…)}} component is rendered as follows:

    script type=”text/javascript”/script

    loading…

    Sorry I had to remove on script so that it is readable

    Ajax load on details column #3664

    JmiXIII
    Member

    >!--
    web2py_component("/test/nc/for.load/1","c282718984176")
    //--<

    loading...

    >!–
    web2py_component(“/test/nc/for.load/1″,”c282718984176”)
    //–<

    is a component inverted

    Ajax load on details column #3673

    Peter Stoev
    Keymaster

    The ‘initrowdetails’ callback function is called when the row details are opened. You can see how the nested grid is initialized in this demo after the user opens the details: nestedgrids.htm

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Ajax load on details column #3870

    JmiXIII
    Member

    Thanks,

    I’ve spent nevertheless hours before understanding why event does not fire.
    Here was the answer :
    http://www.jqwidgets.com/community/topic/bindingcomplete-event-not-firing/

    Still having pb from mixing server call from js but this not related to jqxgrid.

    Good JS Library.

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

You must be logged in to reply to this topic.