jQWidgets Forums

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts

  • m0j0r1s1ng
    Participant

    Thank you very much Peter… that worked great when I adapted it to my code.

    I think my problem was not returning a jqxAdapter from my function… I think I still have some area to work on in regards to Javascript variable scope 😉


    m0j0r1s1ng
    Participant

    I have completely isolated each variable from the global… take a look at the way I set up tab(1) “Carbines” now… each DataAdapter has a unique name, a unique source and a unique array feeding it. Although this column sort is a minor thing, it’s still a bug as far as I can see.


    m0j0r1s1ng
    Participant

    They may be the same name for source: but isn’t each one a totally new and unique object as they are created inside a function where the variables are local to that function? I can try and alter the source and see but I believe I have tried that already. I think it gets confused because all the datasource columns are the same.


    m0j0r1s1ng
    Participant

    so I converted it all to jqxDataAdapters and I still have the same issue where the grids are all identical but with different data values (same columns). In the data adapters, I set a sortcolumn but it only seems to work on the first tab/grid.

    Can you take a peek and let me know if you think this is a bug or am I doing something wrong?

    http://teamgamer.com/bf4-gldstats/index.html

    You need to select at least 1 of the listed soldiers, then click on “Weapon Stats” at the bottom.

    This will take you to the page I am talking about. (http://teamgamer.com/bf4-gldstats/weapons.html)

    See how “Assault Rifles” (the first tab) has its groups sorted by “kills”? Now if you go to the rest of the tabs, the grids are NOT sorted by “kills” any longer, even though each data adapter and each grid were initialized with their own objects (but using the same settings). All the data is correct and it’s correctly retrieving a different dataset per tab/grid, but the “sortcolumn” property is not being applied to subsequent tabs.


    m0j0r1s1ng
    Participant

    fair enough… are you suprised it worked without a jqxDataAdapter? 😉

    in the above code, if I add a declaration in the tab functions, do you know if this will work? I am somewhat new to JS and am wondering if I declare the data adapter in a function that it will be available outside the function.

    What I am talking about is this:

    var tab1 = function (source) {
                  //called when tab(0) is initialized
                  source['data'] = {
                          filter: 'filtervalue1'
                      };
                  var dataadapter1 = new $.jqx.dataAdapter(gridsettings)
                   $('#jqxgrid1').jqxGrid(dataadapter1);  
                };
    var tab2 = function (source) {
                  //called when tab(1) is initialized
                  source['data'] = {
                          filter: 'filtervalue2'
                      };
                   var dataadapter2 = new $.jqx.dataAdapter(gridsettings)
                   $('#jqxgrid2').jqxGrid(dataadapter2);  
                };

    m0j0r1s1ng
    Participant

    ok… thx, I will do that.


    m0j0r1s1ng
    Participant

    Thank you, that was just the hint I was looking for!

    I have asked 2 questions on here so far and have been very pleased with your quick support. I wanted to let you know that the help is VERY much appreciated.

    Are you guys interested in seeing the projects using jqw?

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