:: Forum >>

Is there a work around ?

Hey guys!
thts a real neat one!
and the JIT rendering virtual mode uses is superb.
but I am facing a problem.
Once sorted , Adding rows is giving problems
I think there is a bug in HTTP.Request

but has anyone a solution ?

Tuesday, October 11, 2005
Please provide more information. What are the 'problems'. Show us the HTTPRequest code that you are using. How are you 'adding rows'? Provide some sample code and we can try to help you. Oh, and use your name on your posts so we know who we are helping.
Jim Hunter
Wednesday, October 12, 2005
Hi,
Accept apologies for missing out name.

here is the code while initiating the grid.
// create ActiveWidgets data model - CSV text table
    var table = new AW.CSV.Table;

    // provide data URL - plain text comma-separated file
    table.setURL(path);

    // start asyncronous data retrieval
    table.request();

    // define column labels
    var columns=["Col1", "Col2","Col3","Col4", "Col5", "Col6"];

    // create ActiveWidgets Grid javascript object
    var obj = new AW.UI.Grid;

    obj.setControlSize(740,670);

    // provide column labels
    obj.setHeaderText(columns);

    // number of columns
    obj.setColumnCount(6);
    //obj.setRowCount(100);

    // enable row selectors
    obj.setSelectorVisible(true);
    obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
    obj.setSelectorWidth(40);

    // set row selection
    obj.setSelectionMode("single-row");

    // provide external model as a grid data source
    obj.setCellModel(table);
// write grid html to the page
    document.write(obj);

In the src csv file i keep appending data @ some fixed periodic interval
and then i call a method
function updateTable(){
            table.request();
        }


It works fine, If you dont sort
But once u sort it. Its messed up.
James
Wednesday, October 12, 2005
James,
Have you tried to also call obj.refresh() after the table.request() in updateTable? And you say "messes up", what exactly is it doing or not doing? Thanks for the code, you do clean work. I like it when code is well commented.
Jim Hunter
Friday, October 14, 2005
Hi Jim,
By messed up i mean
"once u sort the grid , no longer u can add rows in that."

and
i tried obj.refresh() after table.request() but it doesn't make a difference.
James
Monday, October 17, 2005
PS:I am using the 2.0.b relase code and haven't made any changes to source code whatsoever.
James
Monday, October 17, 2005
James, I did not test this (so not really sure), but try with a Timeout.

function updateTable(){
window.setTimeout(function(){
table.request();
},30);
}
}
Carlos
Monday, October 17, 2005
Upppsss , sorry, delete last -- } --
Carlos
Monday, October 17, 2005
Sorry, I just did test in ver 1.01 and no Timeout is needed, but a patch from Alex -- dated: Monday, August 16, 2004 -- solve it.
http://activewidgets.com/javascript.forum.1788.28/bug-caused-by-sorting.html
As per your description it seems to be a similar issue , I will try to do some tests in 2.0.
Thanks
Carlos
Monday, October 17, 2005
Did you try this??

function updateTable(){
table.request();
obj.setCellModel(table);
}

Cause I'm not getting errors by add last line, Although up/down arrow-sort-indicator matains last sort (even after the request), so I am wondering there is some kind of conflict here (or I am missing some basic 2.0 functionallity).
Anyway, Alex already post a solution for arrows restoring that can be used:
http://activewidgets.com/javascript.forum.7768.11/using-the-component-for-paged.html
HTH
Carlos
Monday, October 17, 2005
Hi Carlos,
Thanx for da reply.

I hava already tried
function updateTable(){
table.request();
obj.setCellModel(table);
}

and i guess it should not because, it table.request() retrieves data asynchronously.

I have already seen the patch alex suggested on Aug. 16 in
http://activewidgets.com/javascript.forum.1788.28/bug-caused-by-sorting.html

but this patch has to go in Active.HTTP.Request file
so after that how can i again create my "grid.js" for 1.0.1
or "aw.js" for v2.

Any solutions please,

-James
James
Tuesday, October 18, 2005
Hi James,
For ver 1.01 you can simply add the patch-lines at the bottom of grid.js file, but this patch can not be applied to ver 2.0 .
I am still searching for a 2.0 solution .( there is another post about same thing).
Alex, please send us a small comment ........
Thanks
Carlos
Tuesday, October 18, 2005
Hi Alex,
Please show us a way.
James
Wednesday, October 19, 2005

This topic is archived.


Back to support forum

Forum search