Re: Jewel dynamic DataGrid columns

2020-07-20 Thread Greg Dove
As discussed with you directly Carlos, I personally don't think it needs to
be ArrayList.
Usually changing things at this level (swapping 'columns') is rare, but it
should be supported. Flex uses Array here too, and I am guessing similar
considerations were used in the api design for the Flex DataGrids. Unless
we think that those original assumptions have changed or were wrong, then
probably it should be ok to keep it the same (as Array).

I did some work on the emulation component support in recent months and
iirc this wasn't working, so I made it work similar to Flex, and added a
demo/test app for DataGrids in the mxroyale examples for that.
One thing that is important is that the columns array be copied in setter
and getter.  Flex does this also. This means that if you assign the same
array twice it will potentially empty and recreate the content. It might be
possible to inspect and check the contents of the old array for the same
'DataGridColumn' instances that are included in the new one when the setter
is run to optimize some things, but I think it might be something to do as
a subsequent optimization if it is 'needed', because the general case of
swapping the full set of columns, I think is rare.

So i think it is important to use the array.slice() copy in the getter and
setter for internal storage of the columns array, otherwise external
manipulation of the original array instance can mess things up a lot. I saw
this happening in some legacy Flex code until I fixed it in the emulation
components.

One other thing that was quite common I think is the use of the 'visible'
property in DataGridColumn which I don't think we have in Basic or Jewel
(but we do in Flex/emulation).
This is used more often in Flex for hiding columns, and does not require
full refresh of the columns array.





On Tue, Jul 21, 2020 at 3:22 AM Carlos Rovira 
wrote:

> Hi Piotr,
>
> the main point in Datagrid for columns in "columns", but is an Array (maybe
> we could consider to change it to ArrayList?)
>
> In the current implementation, you need to change all the array, and should
> throw away what you have and create a fresh instances of all new columns
> and add dataproviders with data to create rows.
>
> If we had an ArrayList, maybe making an "addItem()" or "addItemAt()" to the
> columns collection could handle just the addition of that column
> without the need to be so aggressive with the rest of data.
>
>
>
> El lun., 20 jul. 2020 a las 12:53, Piotr Zarzycki (<
> piotrzarzyck...@gmail.com>) escribió:
>
> > Hi Guys,
> >
> > I have requirements to have DataGrid where I'm adding/removing columns
> > dynamically. I'm basically going trough the code and trying to figure out
> > how everything works and how to approach that problem.
> >
> > I see that Jewel DataGrid is using class called DataGridButtonBar - It
> > seems to me that I should just manipulate that one - basically adding:
> >
> > header.dataProvider = myNewColumns.
> >
> > However it does not gives me required result, even more my existing
> columns
> > are displaying "undefined" in header text.
> >
> > My general question how would you approach this ?
> >
> > Thanks,
> > --
> >
> > Piotr Zarzycki
> >
> > Patreon: *https://www.patreon.com/piotrzarzycki
> > *
> >
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>


Re: Jewel dynamic DataGrid columns

2020-07-20 Thread Carlos Rovira
Hi Piotr,

the main point in Datagrid for columns in "columns", but is an Array (maybe
we could consider to change it to ArrayList?)

In the current implementation, you need to change all the array, and should
throw away what you have and create a fresh instances of all new columns
and add dataproviders with data to create rows.

If we had an ArrayList, maybe making an "addItem()" or "addItemAt()" to the
columns collection could handle just the addition of that column
without the need to be so aggressive with the rest of data.



El lun., 20 jul. 2020 a las 12:53, Piotr Zarzycki (<
piotrzarzyck...@gmail.com>) escribió:

> Hi Guys,
>
> I have requirements to have DataGrid where I'm adding/removing columns
> dynamically. I'm basically going trough the code and trying to figure out
> how everything works and how to approach that problem.
>
> I see that Jewel DataGrid is using class called DataGridButtonBar - It
> seems to me that I should just manipulate that one - basically adding:
>
> header.dataProvider = myNewColumns.
>
> However it does not gives me required result, even more my existing columns
> are displaying "undefined" in header text.
>
> My general question how would you approach this ?
>
> Thanks,
> --
>
> Piotr Zarzycki
>
> Patreon: *https://www.patreon.com/piotrzarzycki
> *
>


-- 
Carlos Rovira
http://about.me/carlosrovira


Re: Routing revisted

2020-07-20 Thread Andrew Wetmore
@Harbs  could you let me know when you have updated
that page? I will do a doofus check for grammar and suchlike. Very grateful
for this help, as I would not be sure what to say about this feature.

Once that is in place, I will try to populate the related page in the
tutorial.

a

On Mon, Jul 20, 2020 at 5:16 AM Carlos Rovira 
wrote:

> Hi Harbs,
>
> I think Deprecated could be used in both parts since you can deprecate the
> entire class or just some methods or properties. In this case maybe just
> using at class level should be enough. Apart from that, since we're still
> not in 1.0, I think we could remove it directly if you want, since it is
> better to reach 1.0 as clean as possible. That means few people using it
> should get an error and looking a bit will make them find what happens if
> they are not following us. Then after 1.0 I think we should be very
> careful with it. Just my opinion.
>
> About docs, could you update it? I'll be using it to implement in a new
> application.
>
> I updated the TodoMVC example to use HashRouter, but will want to update to
> BrowserRouter when I know how to use it.
>
> Thanks
>
>
>
> El dom., 19 jul. 2020 a las 21:29, Harbs ()
> escribió:
>
> > I added [Deprecated] meta tags for Router. I’m not sure if that goes on
> > the class or the constructor. I added it to both...
> >
> > > On Jul 19, 2020, at 9:08 PM, Harbs  wrote:
> > >
> > >
> > >
> > >> On Jul 19, 2020, at 9:00 PM, Carlos Rovira 
> > wrote:
> > >>
> > >> Hi,
> > >>
> > >> I'm looking to add routing to a royale app embedded in a web page.
> > >> I remember Harbs added HashRouter and BrowserRouter.
> > >>
> > >> 1.- Router is finally deprecated? If so, I think it should be removed
> to
> > >> avoid confusions.
> > >
> > > Yes. It’s deprecated. We can probably remove it. I doubt it’s being
> used.
> > >
> > >> 2.- Could this page [1] be updated to reflect the new classes?
> > > Yes. It should.
> > >
> > >> 3.- For apps embedded in a web page, it's possible to use
> > BrowserRouter? or
> > >> is it mandatory to use HashRouter?
> > >
> > > Either will work.
> > >
> > >> I think this example [2] (TodoMVC-Crux) that is using Router, could be
> > >> updated to BrowserRouter, but I guess that will only work if I change
> > >> .htaccess rewrite rules like Josh said right?
> > >
> > > Correct.
> > >
> > >> The config will be the same just changing "Router" to
> "BrowserRouter"? :
> > >>
> > >> 
> > >> 
> > >> 
> > >> 
> > >>
> > >> [1] https://apache.github.io/royale-docs/features/routing
> > >> [2]
> > >>
> >
> https://github.com/apache/royale-asjs/tree/develop/examples/crux/todomvc-jewel-crux/src/main/royale/jewel/todomvc
> > >> --
> > >> Carlos Rovira
> > >> http://about.me/carlosrovira
> > >
> >
> >
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>


-- 
Andrew Wetmore

http://cottage14.blogspot.com/


Jewel dynamic DataGrid columns

2020-07-20 Thread Piotr Zarzycki
Hi Guys,

I have requirements to have DataGrid where I'm adding/removing columns
dynamically. I'm basically going trough the code and trying to figure out
how everything works and how to approach that problem.

I see that Jewel DataGrid is using class called DataGridButtonBar - It
seems to me that I should just manipulate that one - basically adding:

header.dataProvider = myNewColumns.

However it does not gives me required result, even more my existing columns
are displaying "undefined" in header text.

My general question how would you approach this ?

Thanks,
-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
*


Re: Routing revisted

2020-07-20 Thread Carlos Rovira
Hi Harbs,

I think Deprecated could be used in both parts since you can deprecate the
entire class or just some methods or properties. In this case maybe just
using at class level should be enough. Apart from that, since we're still
not in 1.0, I think we could remove it directly if you want, since it is
better to reach 1.0 as clean as possible. That means few people using it
should get an error and looking a bit will make them find what happens if
they are not following us. Then after 1.0 I think we should be very
careful with it. Just my opinion.

About docs, could you update it? I'll be using it to implement in a new
application.

I updated the TodoMVC example to use HashRouter, but will want to update to
BrowserRouter when I know how to use it.

Thanks



El dom., 19 jul. 2020 a las 21:29, Harbs () escribió:

> I added [Deprecated] meta tags for Router. I’m not sure if that goes on
> the class or the constructor. I added it to both...
>
> > On Jul 19, 2020, at 9:08 PM, Harbs  wrote:
> >
> >
> >
> >> On Jul 19, 2020, at 9:00 PM, Carlos Rovira 
> wrote:
> >>
> >> Hi,
> >>
> >> I'm looking to add routing to a royale app embedded in a web page.
> >> I remember Harbs added HashRouter and BrowserRouter.
> >>
> >> 1.- Router is finally deprecated? If so, I think it should be removed to
> >> avoid confusions.
> >
> > Yes. It’s deprecated. We can probably remove it. I doubt it’s being used.
> >
> >> 2.- Could this page [1] be updated to reflect the new classes?
> > Yes. It should.
> >
> >> 3.- For apps embedded in a web page, it's possible to use
> BrowserRouter? or
> >> is it mandatory to use HashRouter?
> >
> > Either will work.
> >
> >> I think this example [2] (TodoMVC-Crux) that is using Router, could be
> >> updated to BrowserRouter, but I guess that will only work if I change
> >> .htaccess rewrite rules like Josh said right?
> >
> > Correct.
> >
> >> The config will be the same just changing "Router" to "BrowserRouter"? :
> >>
> >> 
> >> 
> >> 
> >> 
> >>
> >> [1] https://apache.github.io/royale-docs/features/routing
> >> [2]
> >>
> https://github.com/apache/royale-asjs/tree/develop/examples/crux/todomvc-jewel-crux/src/main/royale/jewel/todomvc
> >> --
> >> Carlos Rovira
> >> http://about.me/carlosrovira
> >
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira