View Big Data in Virtual Tree

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

View Big Data in Virtual Tree

FriedrichF
Hi,

i have a big Json File (ca. 7MB currently) which i want to view in a virtual Tree widget. The problem is when I try to create the Model with the qx.data.marshal.Json.createModel Method i get an "Uncaught RangeError: Maximum call stack size exceeded" Error.
When i use only a few json Items it works well.

Is there a possability to solve this?
Reply | Threaded
Open this post in threaded view
|

Re: View Big Data in Virtual Tree

Phyo Arkar
do not load huge json at once. Make server send them in chunks.

On Thu, Jul 9, 2015 at 4:24 PM, FriedrichF <[hidden email]> wrote:
Hi,

i have a big Json File (ca. 7MB currently) which i want to view in a virtual
Tree widget. The problem is when I try to create the Model with the
*qx.data.marshal.Json.createModel* Method i get an "*Uncaught RangeError:
Maximum call stack size exceeded*" Error.
When i use only a few json Items it works well.

Is there a possability to solve this?



--
View this message in context: http://qooxdoo.678.n2.nabble.com/View-Big-Data-in-Virtual-Tree-tp7587328.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: View Big Data in Virtual Tree

FriedrichF
Ok i load the Data in chunks, this works well.
Now i want to make the progress with a progressBar visible.
The progressBar doesn't grow, it seems that the GUI doesn't respond while i create the Model.
Is there a workaround or should i use a Spinner gif?
Reply | Threaded
Open this post in threaded view
|

Re: View Big Data in Virtual Tree

oetiker
Today FriedrichF wrote:

> Ok i load the Data in chunks, this works well.
> Now i want to make the progress with a progressBar visible.
> The progressBar doesn't grow, it seems that the GUI doesn't respond while i
> create the Model.
> Is there a workaround or should i use a Spinner gif?

note that javascript is event loop based ... the UI will NOT update
until your code has run through ... you can avoid this by calling
your code in chunks with window.setTimeout(function(){ ... code ... },0);

cheers
tobi

>
>
> --
> View this message in context: http://qooxdoo.678.n2.nabble.com/View-Big-Data-in-Virtual-Tree-tp7587328p7587330.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
www.oetiker.ch [hidden email] +41 62 775 9902


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Group names do not bind properly in custom-bound virtual qx.ui.list.List

Bugdog
Hi Everyone,

I have a virtual List with groups. As could be seen from my code, first
11 items should be in "Group0" and the rest in "Group0".

However I see both groups as "Group0". What am I doing wrong?

Notice I'm using custom group items via "createGroupItem" and
"bindGroupItem".
1. If I just remove these two functions from the imlementation, the
Group names are empty.
2. If I then remove "groupLabelPath" property from the list construction
code, the correct Group Names will appear.
3. Finally if I bring back my methods from #1 the List won't survive
errors during binding.

My code can pasted into playground http://demo.qooxdoo.org/devel/playground

var doc = this.getRoot();

var rawData = [];
for (var i = 0; i < 20; i++)
{
     rawData[i] = {
         label:"Item No " + i,
         group: (i>10) ? "Group1" : "Group0"
     };
}
var model = qx.data.marshal.Json.createModel(rawData);

//create the list
var list = new qx.ui.list.List(model).set({
     labelPath: "label",
     groupLabelPath: "group",
     maxWidth: 200

});

// see qx.ui.list.core.IListDelegate
var delegate =
{
     group : function(data)
     {
         return data.getGroup();
     },

     configureItem : function (item)
     {
       // change appearance
     },

     createGroupItem : function()
     {
         // we need this Composite as GroupItem because the bounds of
GroupItem always managed by List and thus
         // we cannot manipulate its margins, etc
         var item = new qx.ui.container.Composite(new qx.ui.layout.VBox());
         var label = new qx.ui.basic.Label();
         // the label is added to the composite and we can manipulate
its margins
         item.add(label);
         item.$$label = label;
         // margins defined in the Appearance
         return item;
     },

     bindGroupItem : function (controller, item, id)
     {
         var label = item.$$label;

         if (id === 0)
             label.addState("noSeparator");
         else
             label.removeState("noSeparator");

         controller.bindProperty(
             controller.getGroupLabelPath(), "value",
controller.getGroupLabelOptions(), label, id
         );
     }
};

list.setDelegate(delegate);
list.setSelectionMode("additive");

//Pre-Select "Item No 20"
list.getSelection().push(model.getItem(19));
list.getSelection().push(model.getItem(18));

//log selection changes
list.getSelection().addListener("change", function(e) {
   this.debug("Selection: " + list.getSelection().getItem(0));
   console.log( list.getSelection().getItem(0) );
}, this);

doc.add(list);

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Group names do not bind properly in custom-bound virtual qx.ui.list.List

Bugdog
Hi again,

Although the problem remains unresolved for me, I found something.

IListDelegate#bindGroupItem(controller,item,id)  receives an id not
inside model, but inside internal list of groups.



10.07.2015 16:40, Dmitry Pryadkin пишет:

> Hi Everyone,
>
> I have a virtual List with groups. As could be seen from my code, first
> 11 items should be in "Group0" and the rest in "Group0".
>
> However I see both groups as "Group0". What am I doing wrong?
>
> Notice I'm using custom group items via "createGroupItem" and
> "bindGroupItem".
> 1. If I just remove these two functions from the imlementation, the
> Group names are empty.
> 2. If I then remove "groupLabelPath" property from the list construction
> code, the correct Group Names will appear.
> 3. Finally if I bring back my methods from #1 the List won't survive
> errors during binding.
>
> My code can pasted into playground http://demo.qooxdoo.org/devel/playground
>
> var doc = this.getRoot();
>
> var rawData = [];
> for (var i = 0; i < 20; i++)
> {
>       rawData[i] = {
>           label:"Item No " + i,
>           group: (i>10) ? "Group1" : "Group0"
>       };
> }
> var model = qx.data.marshal.Json.createModel(rawData);
>
> //create the list
> var list = new qx.ui.list.List(model).set({
>       labelPath: "label",
>       groupLabelPath: "group",
>       maxWidth: 200
>
> });
>
> // see qx.ui.list.core.IListDelegate
> var delegate =
> {
>       group : function(data)
>       {
>           return data.getGroup();
>       },
>
>       configureItem : function (item)
>       {
>         // change appearance
>       },
>
>       createGroupItem : function()
>       {
>           // we need this Composite as GroupItem because the bounds of
> GroupItem always managed by List and thus
>           // we cannot manipulate its margins, etc
>           var item = new qx.ui.container.Composite(new qx.ui.layout.VBox());
>           var label = new qx.ui.basic.Label();
>           // the label is added to the composite and we can manipulate
> its margins
>           item.add(label);
>           item.$$label = label;
>           // margins defined in the Appearance
>           return item;
>       },
>
>       bindGroupItem : function (controller, item, id)
>       {
>           var label = item.$$label;
>
>           if (id === 0)
>               label.addState("noSeparator");
>           else
>               label.removeState("noSeparator");
>
>           controller.bindProperty(
>               controller.getGroupLabelPath(), "value",
> controller.getGroupLabelOptions(), label, id
>           );
>       }
> };
>
> list.setDelegate(delegate);
> list.setSelectionMode("additive");
>
> //Pre-Select "Item No 20"
> list.getSelection().push(model.getItem(19));
> list.getSelection().push(model.getItem(18));
>
> //log selection changes
> list.getSelection().addListener("change", function(e) {
>     this.debug("Selection: " + list.getSelection().getItem(0));
>     console.log( list.getSelection().getItem(0) );
> }, this);
>
> doc.add(list);
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel