You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by wkoch <wa...@boeing.com> on 2020/12/14 21:27:42 UTC

Grid Sort issues

I have multiple datagrids slaved to a master grid -- pick something on the
master, change event fires a function which does a json call to get for the
slaved grids.  I'm using the DataGridSort bead on all my grids.

when a user sorts the master grid the change event fires and the slaves get
updated again.  How can I tell when the change is a sort and stop the slave
refresh?

How can I reset a grid back to the original order?  In Flex I could set the
ArrayListView.Sort to null and refresh but that has no effect here.



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I thought that might be the case which is why I ran the refresh - I expected
it to do a complete redraw same as the Sort bead is doing.

I just change the code to add in


DP_EA_Items.itemUpdatedAt(dg_EA_Items.selectedIndex);


That did nothing. So I got rid of the bracket notation, created new objects,
and used the collection methods.


var tempObject1:Object;
var tempObject2:Object;
var rtn:Boolean;

tempObject = DP_EA_Items.getItemAt(dg_EA_Items.selectedIndex);
tempObject.AUTHORITY_GROUP = "TheNewGroup";
tempObject2=DP_EA_Items.setItemAt(tempObject, dg_EA_Items.selectedIndex )
rtn=DP_EA_Items.itemUpdatedAt(dg_EA_Items.selectedIndex);


I got a *false* back from the itemUpdatedAt

I guess I'm still confused.  Do I need to add a listener on the item
renderer somehow?  or force a "dataChange" event to fire - i kind of tried
that before but maybe I didn't dispatch the right event?





--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi,

I think that's the problem.
ArrayList and ArrayListView are collection classes that throw
"CollectionEvent" events (check the Collection library code for that
classes).
You're doing changes using bracket notation instead to call the collection
"addItem"or "itemupdated" function that will throw the CollectionEvent
ITEM_ADDED or ITEM_UPDATED. doing that way the collection can't react. For
that reason Jewel use ArrayList as the default collection class instead
Array based data.
so the "dataChange" event is never fired in the item renderer is never
fired and the renderer is not updated.

HTH

Carlos


El sáb, 19 dic 2020 a las 17:45, wkoch (<wa...@boeing.com>)
escribió:

> My apologies.  I really need to give you simple complete code packages
> rather
> than snippets.
>
> Yes -- The data is being changed as part of a JSON return handler.
>
> DP_EA_Items is the ALV for the dg_EA_Items datagrid.
>
> I update using:
>
> DP_EA_Items[dg_EA_Items.selectedIndex].AUTHORITY_GROUP = "TheNewGroup";
>
> which I follow with a:
>
> DP_EA_Items.refresh();
>
> I thought the refresh() would force the grid to display the new value.
>
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
My apologies.  I really need to give you simple complete code packages rather
than snippets.

Yes -- The data is being changed as part of a JSON return handler.

DP_EA_Items is the ALV for the dg_EA_Items datagrid.

I update using:

DP_EA_Items[dg_EA_Items.selectedIndex].AUTHORITY_GROUP = "TheNewGroup";

which I follow with a:

DP_EA_Items.refresh();

I thought the refresh() would force the grid to display the new value.




--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

I think I start to understand the problem. You are changing the ALV
collection "outside" the component right?
Can you share the line of code you're using to update the data in the
record?


El sáb, 19 dic 2020 a las 14:50, wkoch (<wa...@boeing.com>)
escribió:

> No you missed nothing.
>
> I will try a new nightly build when the downloader comes back up.  I'm
> somewhat reluctant to to that since I don't know how to track build numbers
> and I have code in production.  I'll figure something out.
>
> What's bothering me is that when I sort the grid the grid the values render
> properly which leads me to believe that an event is missing.  I dug into
> the
> DataGridSort.as file and see that is just firing 2 events.  I'm wondering
> if
> I need to manually send the dataProviderChanged event.  I just can't figure
> out how to dispatch it...
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
No you missed nothing.  

I will try a new nightly build when the downloader comes back up.  I'm
somewhat reluctant to to that since I don't know how to track build numbers
and I have code in production.  I'll figure something out.

What's bothering me is that when I sort the grid the grid the values render
properly which leads me to believe that an event is missing.  I dug into the
DataGridSort.as file and see that is just firing 2 events.  I'm wondering if
I need to manually send the dataProviderChanged event.  I just can't figure
out how to dispatch it...



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I'm not very good with TDJ but:

You can try changing the 4th card (  columnWidth set to pixels )

Change the card content to:


<j:CardPrimaryContent>					
<j:Label text="Using specific column widths, rowHeight=54 and height=220,
first column uses a custom renderer and last column has right alignment"
multiline="true"/>
	<j:DataGrid localId="dg4" height="205" emphasis="primary" 
		change="dataGridChange(event.target as DataGrid, lb4)"
		dataProvider="{productModel.productList}">
		<j:columns>
			<j:DataGridColumn label="Images" dataField="image" columnWidth="100"
itemRenderer="itemRenderers.ImageDataGridItemRenderer"/>
			<j:DataGridColumn localId="titlecolumn" label="Title" dataField="title"
columnWidth="140"/>
			<j:DataGridColumn label="Sales" dataField="sales" columnWidth="80"
align="right"/>
		</j:columns>
		<j:beads>
			<j:DataGridPresentationModel rowHeight="54"/>
			<j:DataGridSort/>
			<j:RemoveAllDataGridItemRendererForArrayListData/>
		</j:beads>
	</j:DataGrid>
	<j:Label localId="lb4" text="DataGrid selection will be shown here"/>
	<j:Label html="{'Selected Index: ' + dg4.selectedIndex}"/>
	<j:Label localId="selected" html="{describeItem(dg4.selectedItem)}"/>
</j:CardPrimaryContent>				


Add to actions:


<j:Button text="Show Title" click="titlecolumn.visible=true"
emphasis="primary"/>
<j:Button text="Hide Title" click="titlecolumn.visible=false" 
emphasis="primary"/>


Please note that this card is broken -- it won't update the first row
either.



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
SCRIPT5007: Unable to get property 'buttonWidths' of undefined or null
reference



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

Can I check that in TDJ examples? or adding some code to understand how to
reproduce?
I don't know that part of the code since it was done by Greg Dove but can
try to see if there's some similarity.

Thanks



El jue, 24 dic 2020 a las 19:03, wkoch (<wa...@boeing.com>)
escribió:

> I just noticed that other things on the DataGridColumn are having refresh
> issues as well.
>
> Example: Doesn't work if i try to change the visibility of a column or the
> width of a column
>
> I'm guessing it's all tied up in the same issue.
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I just noticed that other things on the DataGridColumn are having refresh
issues as well.  

Example: Doesn't work if i try to change the visibility of a column or the
width of a column

I'm guessing it's all tied up in the same issue.



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren

I get to fix the refresh issue. It was not easy at all. I just committed
the solution now, and while it is working I want to talk with @Harbs in
another thread to see if there's a better solution. Anyway, the current one
is an improvement since :


   - DataGridSort now extends from EasyDataProviderChangeNotifier (a bead
   from Basic)
   - DataGridSort now uses collection.refresh(); instead to create a new
   event "sortChanged"
   - We now use the CollectionEvent.COLLECTION_CHANGED
   - DataGridview is not managing COLLECTION_CHANGED events

The main problem here is this line from ArrayListSelectionModel (the model
used in column lists):

public function set dataProvider(value:Object):void
{
if (value == _dataProvider) return;

This check, that is needed clearly, is preventing the collections to be
refreshed. Since we update just a bit of information in one object, that
prevents the whole collection from refreshing. I added a new
"setDataProvider__NoCheck()"
that skip the previous check, but while this is ok, want to see if there's a
better solution (for that reason talk with Harbs about it).

So I think that should fix your problem. I already added the example in
another commit to Tour De Jewel, so just this code is working ok:

private function updateSelectedItem():void
{
var selectedProduct:Product = (dg2.dataProvider as
IArrayListView).getItemAt(dg2.selectedIndex)
as Product;
selectedProduct.title = "NEW-" + (Math.floor(Math.random()*1000));
(dg2.dataProvider as IArrayListView).itemUpdated(selectedProduct);
}

HTH

Carlos



El dom, 20 dic 2020 a las 16:42, Carlos Rovira (<ca...@apache.org>)
escribió:

> j:DataGridColumnLabelsChange is a bead used when you want to change the
> labels in the column header at runtime.
>
> El dom, 20 dic 2020 a las 16:15, wkoch (<wa...@boeing.com>)
> escribió:
>
>> Interesting.  My grid (with renderers) is exactly the opposite response -
>> I
>> have to sort to get the new values to appear.
>>
>> I noticed you have a bead (<j:DataGridColumnLabelsChange/>) in your grid
>> that I don't.  I added it to my grid -- no change.
>>
>> There has to be an issue with the refresh method as well.  In Flex it
>> redrew
>> everything (with sort if inovked).  Doesn't seem to be doing anything
>> here.
>>
>> Also - If i take the renderers out of the datagrid it still doesn't
>> update.
>>
>>
>>
>> --
>> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>>
>
>
> --
> Carlos Rovira
> Apache Member & Apache Royale PMC
> *Apache Software Foundation*
> http://about.me/carlosrovira
>
>

-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
j:DataGridColumnLabelsChange is a bead used when you want to change the
labels in the column header at runtime.

El dom, 20 dic 2020 a las 16:15, wkoch (<wa...@boeing.com>)
escribió:

> Interesting.  My grid (with renderers) is exactly the opposite response - I
> have to sort to get the new values to appear.
>
> I noticed you have a bead (<j:DataGridColumnLabelsChange/>) in your grid
> that I don't.  I added it to my grid -- no change.
>
> There has to be an issue with the refresh method as well.  In Flex it
> redrew
> everything (with sort if inovked).  Doesn't seem to be doing anything here.
>
> Also - If i take the renderers out of the datagrid it still doesn't update.
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
Interesting.  My grid (with renderers) is exactly the opposite response - I
have to sort to get the new values to appear.

I noticed you have a bead (<j:DataGridColumnLabelsChange/>) in your grid
that I don't.  I added it to my grid -- no change.

There has to be an issue with the refresh method as well.  In Flex it redrew
everything (with sort if inovked).  Doesn't seem to be doing anything here.

Also - If i take the renderers out of the datagrid it still doesn't update.



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

I'm trying the following in TDJ datasort example (the one with
localId="dg2"), and I can reproduce what you said:

private function updateSelectedItem():void
{
var selectedProduct:Product = (dg2.dataProvider as
IArrayList).getItemAt(dg2.selectedIndex)
as Product;
selectedProduct.title = "NEW-" + (Math.random()*100);
productModel.productList.itemUpdated(selectedProduct);
}

the DG is this :

<j:DataGrid localId="dg2" width="100%" height="100%"
dataProvider="{new ArrayListView(productModel.productList)}"
change="lb2.html = describeItem(event.target.selectedItem)">
<j:beads>
<j:DataGridColumnLabelsChange/>
<j:DataGridSort/>
</j:beads>
<j:columns>
<j:DataGridColumn label="Title" dataField="title"/>
<j:DataGridColumn label="Sales" dataField="sales"/>
</j:columns>
</j:DataGrid>

<j:Label localId="lb2" html="DataGrid selection will be shown here"/>

<j:Button text="CHANGE TITLE" click="updateSelectedItem()"/>

(just added the button below)

so if I don't sort, the change can be seen, but when I do a sort and do a
change the change is not reflected.

going to see what could be the problem

Thanks


El dom, 20 dic 2020 a las 3:28, Piotr Zarzycki (<pi...@gmail.com>)
escribió:

> Any error in browsers console?
>
> On Sat, 19 Dec 2020 at 23:14, wkoch <wa...@boeing.com> wrote:
>
>> I downloaded the latest nightly build.  I guess there were a lot of
>> changes
>> since 10/26.  It completely killed my application.  grids, lists, etc.
>> gone,
>> most other functionality gone.  So it looks like I'm stuck at a specific
>> build. Luckily I kept a copy of the old SDK
>>
>>
>>
>> --
>> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>>
> --
>
> Piotr Zarzycki
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: Grid Sort issues

Posted by Piotr Zarzycki <pi...@gmail.com>.
Any error in browsers console?

On Sat, 19 Dec 2020 at 23:14, wkoch <wa...@boeing.com> wrote:

> I downloaded the latest nightly build.  I guess there were a lot of changes
> since 10/26.  It completely killed my application.  grids, lists, etc.
> gone,
> most other functionality gone.  So it looks like I'm stuck at a specific
> build. Luckily I kept a copy of the old SDK
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>
-- 

Piotr Zarzycki

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I downloaded the latest nightly build.  I guess there were a lot of changes
since 10/26.  It completely killed my application.  grids, lists, etc. gone,
most other functionality gone.  So it looks like I'm stuck at a specific
build. Luckily I kept a copy of the old SDK



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

Yes, I already saw that code. What I'm trying to point out is that
itemrenderer code only has the root tag (DataGridItemRenderer) and then a
beads node with three beads inside, but there's no more code that tries to
bind properties or something, so I was asking if there was something
missing. If not I'll try to imagine what could be going on, but I was
expecting some problems due to the custom itemrenderer binding setup.

Anyway, I saw some binding fixes in the last day so please try to check
with latest code to see if that fixes it

thanks



El vie, 18 dic 2020 a las 20:19, wkoch (<wa...@boeing.com>)
escribió:

> I posted 3 snippets on Dec 17.
>
> The first snip is the data grid itself.    the DataGridColumn columns are
> tied to itemRenderers
>
> Here is the file it's pointing to
>
> MyDataGridColumnRenderer.mxml
> <
> http://apache-royale-users.20374.n8.nabble.com/file/t177/MyDataGridColumnRenderer.mxml>
>
>
> I have both ApplicationDataBinding and ContainerDataBinding called out in
> the the primary MXML
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I posted 3 snippets on Dec 17.

The first snip is the data grid itself.    the DataGridColumn columns are
tied to itemRenderers

Here is the file it's pointing to

MyDataGridColumnRenderer.mxml
<http://apache-royale-users.20374.n8.nabble.com/file/t177/MyDataGridColumnRenderer.mxml>  

I have both ApplicationDataBinding and ContainerDataBinding called out in
the the primary MXML



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

just checking your code now, and in the renderers I don't see any binding.
The problem you mentioned was that renderer is not updating
I think you didn't post all the code of the renderer and also posted 2
renderers. I'm confused about where should I look
thanks

El vie, 18 dic 2020 a las 20:03, wkoch (<wa...@boeing.com>)
escribió:

> I'm wondering if I am missing a Bead somewhere?
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I'm wondering if I am missing a Bead somewhere?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
		
<j:DataGrid localId="dg_EA_Items" y="85"  height="169"
dataProvider="{DP_EA_Items}" change="dg_EA_Items_Change()">
		<j:beads>
			<j:DataGridPresentationModel rowHeight="20" variableRowHeight="false"/>
			<j:DataGridSort/>
			<j:RemoveAllDataGridItemRendererForArrayListData/>
		</j:beads>
		<j:columns>
			<j:DataGridColumn label="Transaction ID"             
dataField="TRANSACTION_ID"        columnWidth="350"
itemRenderer="renderers.MyDataGridColumnRenderer"/>
			<j:DataGridColumn label="Group"                      
dataField="AUTHORITY_GROUP"       columnWidth="60" 
itemRenderer="renderers.MyDataGridColumnRendererCenter"/>
		</j:columns>
	</j:DataGrid>
		


MyDataGridColumnRenderer

<j:DataGridItemRenderer 
	xmlns:f="http://ns.adobe.com/mxml/2009" 
	xmlns:j="library://ns.apache.org/royale/jewel" 
	xmlns:b="library://ns.apache.org/royale/basic">    
	<j:beads>
		<b:ItemRendererDataBinding/>
		<b:Paddings paddingLeft="5" paddingRight="3" paddingTop="0"
paddingBottom="0"/>
		<j:VerticalLayout itemsVerticalAlign="itemsCenter" />
	</j:beads>    
</j:DataGridItemRenderer>



MyDataGridColumnRendererCenter

<j:DataGridItemRenderer 
	xmlns:f="http://ns.adobe.com/mxml/2009" 
	xmlns:j="library://ns.apache.org/royale/jewel" 
	xmlns:b="library://ns.apache.org/royale/basic">    
	<j:beads>
		<b:ItemRendererDataBinding/>
		<b:Paddings paddingLeft="5" paddingRight="3" paddingTop="0"
paddingBottom="0"/>
		<j:VerticalLayout itemsVerticalAlign="itemsCenter"
itemsHorizontalAlign="itemsCenter"/>
	</j:beads>    
</j:DataGridItemRenderer>





--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi,

that should not be a sort or dg refresh issue but something at renderer
level where the binding is not working as expected.
Can you post here (or in a paste.apache.org) the renderer code?

El jue, 17 dic 2020 a las 6:36, ichsan anam (<ic...@gmail.com>)
escribió:

> maybe this work, base on tdj sample code.
>
> datagrid.dataprovider=null;
> datagrid.dataprovider=somearraylist;
>
> Regards
>
> On Thu, Dec 17, 2020 at 6:20 AM wkoch <wa...@boeing.com> wrote:
>
>> I managed to work around the sort event.  Still haven't figured out the
>> "restore" issue.  As far as suggesting a patch -- right now I am too deep
>> into re-coding tons of stuff to even think. Maybe later next year when I
>> can
>> breathe a little....
>>
>> Now I'm having another issue.  I'm manually changing a data element in the
>> ArrayListView but I can't get the grid to display the change.  I tried an
>> arraylistview.refresh but that didn't trigger the Datagrid to refresh. I
>> also tried .dispatchEvent(new Event("dataProviderChanged")) and that
>> failed.
>> I know the element is changing because if I sort the grid the new data
>> appears. I'm sure I'm missing something easy....
>>
>> I looked in TDJ but the datagrid "columnWidth set to pixels" update first
>> row button doesn't work either.
>>
>> How can I force a datagrid refresh?
>>
>>
>>
>> --
>> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>>
>

-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: Grid Sort issues

Posted by ichsan anam <ic...@gmail.com>.
maybe this work, base on tdj sample code.

datagrid.dataprovider=null;
datagrid.dataprovider=somearraylist;

Regards

On Thu, Dec 17, 2020 at 6:20 AM wkoch <wa...@boeing.com> wrote:

> I managed to work around the sort event.  Still haven't figured out the
> "restore" issue.  As far as suggesting a patch -- right now I am too deep
> into re-coding tons of stuff to even think. Maybe later next year when I
> can
> breathe a little....
>
> Now I'm having another issue.  I'm manually changing a data element in the
> ArrayListView but I can't get the grid to display the change.  I tried an
> arraylistview.refresh but that didn't trigger the Datagrid to refresh. I
> also tried .dispatchEvent(new Event("dataProviderChanged")) and that
> failed.
> I know the element is changing because if I sort the grid the new data
> appears. I'm sure I'm missing something easy....
>
> I looked in TDJ but the datagrid "columnWidth set to pixels" update first
> row button doesn't work either.
>
> How can I force a datagrid refresh?
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I managed to work around the sort event.  Still haven't figured out the
"restore" issue.  As far as suggesting a patch -- right now I am too deep
into re-coding tons of stuff to even think. Maybe later next year when I can
breathe a little....

Now I'm having another issue.  I'm manually changing a data element in the
ArrayListView but I can't get the grid to display the change.  I tried an
arraylistview.refresh but that didn't trigger the Datagrid to refresh. I
also tried .dispatchEvent(new Event("dataProviderChanged")) and that failed.  
I know the element is changing because if I sort the grid the new data
appears. I'm sure I'm missing something easy....

I looked in TDJ but the datagrid "columnWidth set to pixels" update first
row button doesn't work either.

How can I force a datagrid refresh?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

I imagine that you have the same ALV in all slaves and you need to add one
per grid so each one is a view of the original data (filtered and sorted)
in its own way without affecting the others.

About reset the sort, I didn't try it and maybe @Greg Dove
<gr...@gmail.com> could give more thoughts on this.
Also, I think that could be a good opportunity to try to suggest a patch
for that since seems something located in a concrete point. You dare?

thanks

El lun, 14 dic 2020 a las 22:28, wkoch (<wa...@boeing.com>)
escribió:

> I have multiple datagrids slaved to a master grid -- pick something on the
> master, change event fires a function which does a json call to get for the
> slaved grids.  I'm using the DataGridSort bead on all my grids.
>
> when a user sorts the master grid the change event fires and the slaves get
> updated again.  How can I tell when the change is a sort and stop the slave
> refresh?
>
> How can I reset a grid back to the original order?  In Flex I could set the
> ArrayListView.Sort to null and refresh but that has no effect here.
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: [EXTERNAL] Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Great you get the issue solved Warren! :)


El dom, 3 ene 2021 a las 20:38, wkoch (<wa...@boeing.com>) escribió:

> I went ahead and loaded moonshine with today's build.
>
> I did a Clean Project and re-compiled.  And now the error is gone.  The
> only
> thing I can think of was something was trapped in the CSS.
>
> Now I can get back to actually coding after I verify all the build changes
> since October didn't change something else...
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: [EXTERNAL] Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I went ahead and loaded moonshine with today's build.  

I did a Clean Project and re-compiled.  And now the error is gone.  The only
thing I can think of was something was trapped in the CSS.

Now I can get back to actually coding after I verify all the build changes
since October didn't change something else...



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: [EXTERNAL] Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

it's ok to find "org.apache.royale.html.beads.models.ButtonBarModel" in the
frameworks folder since is the bead for Basic and probably used in Express
and even could be used in emulation (MX/Spark), but you should not find a
single match in Jewel.

If you reduced the problem to DG thats very good. You know need to do the
same putting back a single DG little by little until you find where is the
issue. Think that TDJ is working. Another thing could be to ensure the
nightly build is used correctly and there's no tries to use the older
version, also use the latest, or build locally.

I guess you should be very near to find where is the issue

Thanks

El dom, 3 ene 2021 a las 16:51, wkoch (<wa...@boeing.com>) escribió:

> I took apart my code bit by bit as you suggested, including stripping all
> the
> beads and renderers off the datagrid.  The problem went away when I finally
> removed the datagrid completely.
>
> I did a scan across the royale-asjs\frameworks folder in the SDK and found
> many places where org.apache.royale.html.beads.models.ButtonBarModel  is
> called out.
>
> So I would say No all is not ok in the SDK.
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: [EXTERNAL] Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I took apart my code bit by bit as you suggested, including stripping all the
beads and renderers off the datagrid.  The problem went away when I finally
removed the datagrid completely.  

I did a scan across the royale-asjs\frameworks folder in the SDK and found
many places where org.apache.royale.html.beads.models.ButtonBarModel  is
called out.

So I would say No all is not ok in the SDK.



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: [EXTERNAL] Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

sorry but SDK is checked, the older bead is used in Basic and the new in
Jewel. All is ok.
One way to find issues is comment or disconnect parts of your app to reach
a working state, then add up to the mix until you get the fail and isolate
the point where you have the problem. I did this lots of times to find
issues and fix my code.
Eventually you can find an issue in Royale, if that's the case isolate and
report.

Thanks

El sáb, 2 ene 2021 a las 19:08, wkoch (<wa...@boeing.com>) escribió:

> I have no place in my code that directly references that bead.  I don't use
> the ButtonBar anywhere.  I suspect it's coming in indirectly from the
> datagrid.
>
> Should I be looking in the SDK?
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: [EXTERNAL] Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I have no place in my code that directly references that bead.  I don't use
the ButtonBar anywhere.  I suspect it's coming in indirectly from the
datagrid.

Should I be looking in the SDK? 



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

RE: [EXTERNAL] Re: Grid Sort issues

Posted by Maria Jose Esteve <mj...@iest.com>.
Hi Warren,
The same error happened to me as it did to you, and as Carlos says, the origin was the change from html ButtonBarModel to jewel ButtonBarModel.
In my case, I had a custom component that extended from ButtonBar.
Carlos's advice, for me, is correct, download and compile the SDK every day because right now there are many changes that you can handle daily but that can become a very complicated task if you accumulate them.

Hiedra.

De: Carlos Rovira <ca...@apache.org>
Enviado el: sábado, 2 de enero de 2021 10:23
Para: users@royale.apache.org
Asunto: Re: [EXTERNAL] Re: Grid Sort issues

Hi Warren,

I think I know what the problem is: ButtonBarModel was changed for a jewel version that uses ArrayListSelectionModel, since other users reported a problem with selection in ButtonBar.

So please seek in your code for
  `org.apache.royale.html.beads.models.ButtonBarModel`
and change to
  `org.apache.royale.jewel.beads.models.ButtonBarModel`

For this kind of thing I ended doing daily builds and investing some minutes on catching up with the changes people are doing.
If not, it can be a very daunting task to keep synced, and impossible as the time passes.

HTH

Carlos



El jue, 31 dic 2020 a las 17:59, wkoch (<wa...@boeing.com>>) escribió:
I'm hoping this will help.  It's a snippet from the Release JS code.  If not
please tell me what you need to get more context.

D('org.apache.royale.geom.Point.prototype.subtract',gt.prototype.subtract);gt.prototype.add=function(a){return
new
gt(this.x+a.x,this.y+a.y)};D('org.apache.royale.geom.Point.prototype.add',gt.prototype.add);gt.prototype.normalize=function(a){var
b=this.length;0<b&amp;&amp;(b=a/b,this.x*=b,this.y*=b)};D('org.apache.royale.geom.Point.prototype.normalize',gt.prototype.normalize);gt.prototype.toString=function(){return'(x='+this.x+',
y='+this.y+')'};D('org.apache.royale.geom.Point.prototype.toString',gt.prototype.toString);
gt.prototype.copyFrom=function(a){this.x=a.x;this.y=a.y};D('org.apache.royale.geom.Point.prototype.copyFrom',gt.prototype.copyFrom);gt.prototype.setTo=function(a,b){this.x=a;this.y=b};D('org.apache.royale.geom.Point.prototype.setTo',gt.prototype.setTo);gt.prototype.Ga<http://gt.prototype.Ga>=function(){return
Math.sqrt(this.x*this.x+this.y*this.y)};Object.defineProperties(gt.prototype,{length:{get:gt.prototype.Ga<http://gt.prototype.Ga>}});gt.prototype.g={names:[{name:'Point',i:gh,kind:t}]};function
ht(){L.call(this)}E(ht,L);D(kh,ht);C=ht.prototype;C.createElement=function(){qo(this,Nd);this.Mh=this.element;this.ed=new
sr;this.element.appendChild(this.ed.element);this.element.appendChild(document.createTextNode(''));this.ed.element.royale_wrapper=this;this.typeNames='CheckBox
CheckBoxIcon';return this.element};C.C=function(){return
G.o(this.Mh.childNodes.item(1).nodeValue)};C.F=function(a){this.Mh.childNodes.item(1).nodeValue=a};C.Ia=function(){return
this.ed.element.checked};
C.Va=function(a){this.ed.element.checked=a};Object.defineProperties(ht.prototype,{text:{get:ht.prototype.C,set:ht.prototype.F},selected:{get:ht.prototype.Ia,set:ht.prototype.Va<http://ht.prototype.Va>}});ht.prototype.g={names:[{name:'CheckBox',i:kh,kind:t}]};function
Zq(){}E(Zq,Rr);D('org.apache.royale.jewel.beads.layouts.DataGridColumnLayout',Zq);Zq.LAYOUT_TYPE_NAMES=Qd;D('org.apache.royale.jewel.beads.layouts.DataGridColumnLayout.LAYOUT_TYPE_NAMES',Zq.LAYOUT_TYPE_NAMES);Zq.prototype.beadsAddedHandler=function(){Zq.s.beadsAddedHandler.apply(this);this.si<http://this.si>=G.as(G.as(this.host,wn).getBeadByType(Yq),Yq);this.hostComponent.addEventListener('headerLayout',G.j(this.ti,this,Ak));this.hostComponent.addEventListener(Yc,G.j(this.ti,this,Ak))};
D('org.apache.royale.jewel.beads.layouts.DataGridColumnLayout.prototype.beadsAddedHandler',Zq.prototype.beadsAddedHandler);Zq.prototype.ld=0;Zq.prototype.ti=function(a){var
b=this.datagrid.view.listArea.element;b=b.offsetWidth-b.clientWidth;a=a.type==Yc;if(b!=this.ld||a)this.ld=b,this.ri=!0,a||this.layout()};
Zq.prototype.layout=function(){var
a=this.layoutView,b=a.numElements;if(0>=b)return!1;for(var
d,f,h=0;h<b;h++){var
k=a.getElementAt(h);null!=k&amp;&amp;k.visible&amp;&amp;G.is(k,Hn)&amp;&amp;(d=k,this.si.buttonWidths?(f=this.si<http://this.si>.buttonWidths[h],f.configureWidth(k)):this.kd&amp;&amp;(this.kd.configureWidth(k),f=this.kd))}d&amp;&amp;(this.ri||this.ld)&amp;&amp;(f.applyRightOffset(d,this.ld),this.ri=!1);return
Zq.s.layout.apply(this)};D('org.apache.royale.jewel.beads.layouts.DataGridColumnLayout.prototype.layout',Zq.prototype.layout);
Zq.prototype.Lb<http://Zq.prototype.Lb>=function(){return
this._strand.parent};Zq.prototype.Lj=B('kd');Zq.prototype.Go=A('kd');Object.defineProperties(Zq.prototype,{datagrid:{get:Zq.prototype.Lb<http://Zq.prototype.Lb>},defaultWidth:{get:Zq.prototype.Lj,set:Zq.prototype.Go}});function
it(){}E(it,qq);D(Zi,it);it.prototype.layout=Rl(!0);D('org.apache.royale.jewel.beads.layouts.ViewLayout.prototype.layout',it.prototype.layout);it.prototype.g={names:[{name:'ViewLayout',i:Zi,kind:t}]};function
qo(a,b){b=document.createElement(b);return
a.element=b}D('org.apache.royale.html.util.addElementToWrapper',qo);function
jt(){}D(ti,jt);C=jt.prototype;C.handleItemAdded=function(a){a.item.addEventListener(zd,G.j(this.selectedHandler,this,el))};C.handleItemRemoved=function(a){a.item.removeEventListener(zd,G.j(this.selectedHandler,this,el))};C.selectedHandler=function(a){this.model.selectedIndex=a.index>>0;this.model.selectedItem=a.data;this.view.host.dispatchEvent(new
K(K.CHANGE))};C.modelChangeHandler=function(a){G.as(this.Ye,F,!0).dispatchEvent(new
K(a.type))};
C.m=function(a){this.Ye=a;this.model=G.as(a.getBeadByType(Lr),Lr);this.Ye.addEventListener(xd,G.j(this.handleItemAdded,this,Uc));this.Ye.addEventListener(Ad,G.j(this.handleItemRemoved,this,Wc));G.is(this.model,Ir)?G.as(this.model,Ir,!0).dispatcher=a:(this.model.addEventListener(il,G.j(this.modelChangeHandler,this,Xd)),this.model.addEventListener(vc,G.j(this.modelChangeHandler,this,Xd)))};Object.defineProperties(jt.prototype,{strand:{set:jt.prototype.m}});
jt.prototype.g={names:[{name:'DropDownListController',i:ti,kind:t}],l:[po]};function
kt(){}D(tf,kt);kt.prototype.applyImageData=z();kt.prototype.g={names:[{name:'IImage',i:tf,kind:v}],l:[Qp]};function
lt(){O.call(this)}E(lt,O);D(Kg,lt);lt.prototype.applyImageData=z();D('org.apache.royale.core.supportClasses.StyledImageBase.prototype.applyImageData',lt.prototype.applyImageData);lt.prototype.Dl=function(){return
this.model.url};lt.prototype.bq=function(a){this.model.url=a};lt.prototype.Qb=Rl(null);Object.defineProperties(lt.prototype,{src:{get:lt.prototype.Dl,set:lt.prototype.bq},imageElement:{get:lt.prototype.Qb}});lt.prototype.g={names:[{name:'StyledImageBase',i:Kg,kind:t}],l:[kt]};function
mt(a,b,d){a='undefined'!==typeof a?a:null;b='undefined'!==typeof
b?b:null;d='undefined'!==typeof
d?d:!1;J.call(this);this.fields=a;this.compareFunction=b;this.unique=d}E(mt,J);D(Ee,mt);mt.ANY_INDEX_MODE='any';D('org.apache.royale.collections.Sort.ANY_INDEX_MODE',mt.ANY_INDEX_MODE);mt.FIRST_INDEX_MODE='first';D('org.apache.royale.collections.Sort.FIRST_INDEX_MODE',mt.FIRST_INDEX_MODE);mt.LAST_INDEX_MODE='last';D('org.apache.royale.collections.Sort.LAST_INDEX_MODE',mt.LAST_INDEX_MODE);




--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


--
Carlos Rovira
Apache Member & Apache Royale PMC
Apache Software Foundation
http://about.me/carlosrovira


Re: [EXTERNAL] Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

I think I know what the problem is: ButtonBarModel was changed for a jewel
version that uses ArrayListSelectionModel, since other users reported a
problem with selection in ButtonBar.

So please seek in your code for
  `org.apache.royale.html.beads.models.ButtonBarModel`
and change to
  `org.apache.royale.jewel.beads.models.ButtonBarModel`

For this kind of thing I ended doing daily builds and investing some
minutes on catching up with the changes people are doing.
If not, it can be a very daunting task to keep synced, and impossible as
the time passes.

HTH

Carlos



El jue, 31 dic 2020 a las 17:59, wkoch (<wa...@boeing.com>)
escribió:

> I'm hoping this will help.  It's a snippet from the Release JS code.  If
> not
> please tell me what you need to get more context.
>
>
> D('org.apache.royale.geom.Point.prototype.subtract',gt.prototype.subtract);gt.prototype.add=function(a){return
> new
>
> gt(this.x+a.x,this.y+a.y)};D('org.apache.royale.geom.Point.prototype.add',gt.prototype.add);gt.prototype.normalize=function(a){var
>
> b=this.length;0<b&amp;&amp;(b=a/b,this.x*=b,this.y*=b)};D('org.apache.royale.geom.Point.prototype.normalize',gt.prototype.normalize);gt.prototype.toString=function(){return'(x='+this.x+',
>
> y='+this.y+')'};D('org.apache.royale.geom.Point.prototype.toString',gt.prototype.toString);
>
> gt.prototype.copyFrom=function(a){this.x=a.x;this.y=a.y};D('org.apache.royale.geom.Point.prototype.copyFrom',gt.prototype.copyFrom);gt.prototype.setTo=function(a,b){this.x=a;this.y=b};D('org.apache.royale.geom.Point.prototype.setTo',gt.prototype.setTo);
> gt.prototype.Ga=function(){return
>
> Math.sqrt(this.x*this.x+this.y*this.y)};Object.defineProperties(gt.prototype,{length:{get:
> gt.prototype.Ga
> }});gt.prototype.g={names:[{name:'Point',i:gh,kind:t}]};function
>
> ht(){L.call(this)}E(ht,L);D(kh,ht);C=ht.prototype;C.createElement=function(){qo(this,Nd);this.Mh=this.element;this.ed=new
>
> sr;this.element.appendChild(this.ed.element);this.element.appendChild(document.createTextNode(''));this.ed.element.royale_wrapper=this;this.typeNames='CheckBox
> CheckBoxIcon';return this.element};C.C=function(){return
>
> G.o(this.Mh.childNodes.item(1).nodeValue)};C.F=function(a){this.Mh.childNodes.item(1).nodeValue=a};C.Ia=function(){return
> this.ed.element.checked};
>
> C.Va=function(a){this.ed.element.checked=a};Object.defineProperties(ht.prototype,{text:{get:ht.prototype.C,set:ht.prototype.F},selected:{get:ht.prototype.Ia,set:
> ht.prototype.Va
> }});ht.prototype.g={names:[{name:'CheckBox',i:kh,kind:t}]};function
>
> Zq(){}E(Zq,Rr);D('org.apache.royale.jewel.beads.layouts.DataGridColumnLayout',Zq);Zq.LAYOUT_TYPE_NAMES=Qd;D('org.apache.royale.jewel.beads.layouts.DataGridColumnLayout.LAYOUT_TYPE_NAMES',Zq.LAYOUT_TYPE_NAMES);Zq.prototype.beadsAddedHandler=function(){Zq.s.beadsAddedHandler.apply(this);
> this.si
> =G.as(G.as(this.host,wn).getBeadByType(Yq),Yq);this.hostComponent.addEventListener('headerLayout',G.j(this.ti,this,Ak));this.hostComponent.addEventListener(Yc,G.j(this.ti,this,Ak))};
>
> D('org.apache.royale.jewel.beads.layouts.DataGridColumnLayout.prototype.beadsAddedHandler',Zq.prototype.beadsAddedHandler);Zq.prototype.ld=0;Zq.prototype.ti=function(a){var
>
> b=this.datagrid.view.listArea.element;b=b.offsetWidth-b.clientWidth;a=a.type==Yc;if(b!=this.ld||a)this.ld=b,this.ri=!0,a||this.layout()};
> Zq.prototype.layout=function(){var
> a=this.layoutView,b=a.numElements;if(0>=b)return!1;for(var
> d,f,h=0;h<b;h++){var
>
> k=a.getElementAt(h);null!=k&amp;&amp;k.visible&amp;&amp;G.is(k,Hn)&amp;&amp;(d=k,this.si.buttonWidths?(f=
> this.si
> .buttonWidths[h],f.configureWidth(k)):this.kd&amp;&amp;(this.kd.configureWidth(k),f=this.kd))}d&amp;&amp;(this.ri||this.ld)&amp;&amp;(f.applyRightOffset(d,this.ld),this.ri=!1);return
>
> Zq.s.layout.apply(this)};D('org.apache.royale.jewel.beads.layouts.DataGridColumnLayout.prototype.layout',Zq.prototype.layout);
> Zq.prototype.Lb=function(){return
>
> this._strand.parent};Zq.prototype.Lj=B('kd');Zq.prototype.Go=A('kd');Object.defineProperties(Zq.prototype,{datagrid:{get:
> Zq.prototype.Lb
> },defaultWidth:{get:Zq.prototype.Lj,set:Zq.prototype.Go}});function
>
> it(){}E(it,qq);D(Zi,it);it.prototype.layout=Rl(!0);D('org.apache.royale.jewel.beads.layouts.ViewLayout.prototype.layout',it.prototype.layout);it.prototype.g={names:[{name:'ViewLayout',i:Zi,kind:t}]};function
> qo(a,b){b=document.createElement(b);return
>
> a.element=b}D('org.apache.royale.html.util.addElementToWrapper',qo);function
>
> jt(){}D(ti,jt);C=jt.prototype;C.handleItemAdded=function(a){a.item.addEventListener(zd,G.j(this.selectedHandler,this,el))};C.handleItemRemoved=function(a){a.item.removeEventListener(zd,G.j(this.selectedHandler,this,el))};C.selectedHandler=function(a){this.model.selectedIndex=a.index>>0;this.model.selectedItem=a.data;this.view.host.dispatchEvent(new
>
> K(K.CHANGE))};C.modelChangeHandler=function(a){G.as(this.Ye,F,!0).dispatchEvent(new
> K(a.type))};
>
> C.m=function(a){this.Ye=a;this.model=G.as(a.getBeadByType(Lr),Lr);this.Ye.addEventListener(xd,G.j(this.handleItemAdded,this,Uc));this.Ye.addEventListener(Ad,G.j(this.handleItemRemoved,this,Wc));G.is(this.model,Ir)?G.as(this.model,Ir,!0).dispatcher=a:(this.model.addEventListener(il,G.j(this.modelChangeHandler,this,Xd)),this.model.addEventListener(vc,G.j(this.modelChangeHandler,this,Xd)))};Object.defineProperties(jt.prototype,{strand:{set:jt.prototype.m}});
>
> jt.prototype.g={names:[{name:'DropDownListController',i:ti,kind:t}],l:[po]};function
>
> kt(){}D(tf,kt);kt.prototype.applyImageData=z();kt.prototype.g={names:[{name:'IImage',i:tf,kind:v}],l:[Qp]};function
>
> lt(){O.call(this)}E(lt,O);D(Kg,lt);lt.prototype.applyImageData=z();D('org.apache.royale.core.supportClasses.StyledImageBase.prototype.applyImageData',lt.prototype.applyImageData);lt.prototype.Dl=function(){return
>
> this.model.url};lt.prototype.bq=function(a){this.model.url=a};lt.prototype.Qb=Rl(null);Object.defineProperties(lt.prototype,{src:{get:lt.prototype.Dl,set:lt.prototype.bq},imageElement:{get:lt.prototype.Qb}});lt.prototype.g={names:[{name:'StyledImageBase',i:Kg,kind:t}],l:[kt]};function
> mt(a,b,d){a='undefined'!==typeof a?a:null;b='undefined'!==typeof
> b?b:null;d='undefined'!==typeof
>
> d?d:!1;J.call(this);this.fields=a;this.compareFunction=b;this.unique=d}E(mt,J);D(Ee,mt);mt.ANY_INDEX_MODE='any';D('org.apache.royale.collections.Sort.ANY_INDEX_MODE',mt.ANY_INDEX_MODE);mt.FIRST_INDEX_MODE='first';D('org.apache.royale.collections.Sort.FIRST_INDEX_MODE',mt.FIRST_INDEX_MODE);mt.LAST_INDEX_MODE='last';D('org.apache.royale.collections.Sort.LAST_INDEX_MODE',mt.LAST_INDEX_MODE);
>
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: [EXTERNAL] Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I'm hoping this will help.  It's a snippet from the Release JS code.  If not
please tell me what you need to get more context.

D('org.apache.royale.geom.Point.prototype.subtract',gt.prototype.subtract);gt.prototype.add=function(a){return
new
gt(this.x+a.x,this.y+a.y)};D('org.apache.royale.geom.Point.prototype.add',gt.prototype.add);gt.prototype.normalize=function(a){var
b=this.length;0<b&amp;&amp;(b=a/b,this.x*=b,this.y*=b)};D('org.apache.royale.geom.Point.prototype.normalize',gt.prototype.normalize);gt.prototype.toString=function(){return'(x='+this.x+',
y='+this.y+')'};D('org.apache.royale.geom.Point.prototype.toString',gt.prototype.toString);
gt.prototype.copyFrom=function(a){this.x=a.x;this.y=a.y};D('org.apache.royale.geom.Point.prototype.copyFrom',gt.prototype.copyFrom);gt.prototype.setTo=function(a,b){this.x=a;this.y=b};D('org.apache.royale.geom.Point.prototype.setTo',gt.prototype.setTo);gt.prototype.Ga=function(){return
Math.sqrt(this.x*this.x+this.y*this.y)};Object.defineProperties(gt.prototype,{length:{get:gt.prototype.Ga}});gt.prototype.g={names:[{name:'Point',i:gh,kind:t}]};function
ht(){L.call(this)}E(ht,L);D(kh,ht);C=ht.prototype;C.createElement=function(){qo(this,Nd);this.Mh=this.element;this.ed=new
sr;this.element.appendChild(this.ed.element);this.element.appendChild(document.createTextNode(''));this.ed.element.royale_wrapper=this;this.typeNames='CheckBox
CheckBoxIcon';return this.element};C.C=function(){return
G.o(this.Mh.childNodes.item(1).nodeValue)};C.F=function(a){this.Mh.childNodes.item(1).nodeValue=a};C.Ia=function(){return
this.ed.element.checked};
C.Va=function(a){this.ed.element.checked=a};Object.defineProperties(ht.prototype,{text:{get:ht.prototype.C,set:ht.prototype.F},selected:{get:ht.prototype.Ia,set:ht.prototype.Va}});ht.prototype.g={names:[{name:'CheckBox',i:kh,kind:t}]};function
Zq(){}E(Zq,Rr);D('org.apache.royale.jewel.beads.layouts.DataGridColumnLayout',Zq);Zq.LAYOUT_TYPE_NAMES=Qd;D('org.apache.royale.jewel.beads.layouts.DataGridColumnLayout.LAYOUT_TYPE_NAMES',Zq.LAYOUT_TYPE_NAMES);Zq.prototype.beadsAddedHandler=function(){Zq.s.beadsAddedHandler.apply(this);this.si=G.as(G.as(this.host,wn).getBeadByType(Yq),Yq);this.hostComponent.addEventListener('headerLayout',G.j(this.ti,this,Ak));this.hostComponent.addEventListener(Yc,G.j(this.ti,this,Ak))};
D('org.apache.royale.jewel.beads.layouts.DataGridColumnLayout.prototype.beadsAddedHandler',Zq.prototype.beadsAddedHandler);Zq.prototype.ld=0;Zq.prototype.ti=function(a){var
b=this.datagrid.view.listArea.element;b=b.offsetWidth-b.clientWidth;a=a.type==Yc;if(b!=this.ld||a)this.ld=b,this.ri=!0,a||this.layout()};
Zq.prototype.layout=function(){var
a=this.layoutView,b=a.numElements;if(0>=b)return!1;for(var
d,f,h=0;h<b;h++){var
k=a.getElementAt(h);null!=k&amp;&amp;k.visible&amp;&amp;G.is(k,Hn)&amp;&amp;(d=k,this.si.buttonWidths?(f=this.si.buttonWidths[h],f.configureWidth(k)):this.kd&amp;&amp;(this.kd.configureWidth(k),f=this.kd))}d&amp;&amp;(this.ri||this.ld)&amp;&amp;(f.applyRightOffset(d,this.ld),this.ri=!1);return
Zq.s.layout.apply(this)};D('org.apache.royale.jewel.beads.layouts.DataGridColumnLayout.prototype.layout',Zq.prototype.layout);
Zq.prototype.Lb=function(){return
this._strand.parent};Zq.prototype.Lj=B('kd');Zq.prototype.Go=A('kd');Object.defineProperties(Zq.prototype,{datagrid:{get:Zq.prototype.Lb},defaultWidth:{get:Zq.prototype.Lj,set:Zq.prototype.Go}});function
it(){}E(it,qq);D(Zi,it);it.prototype.layout=Rl(!0);D('org.apache.royale.jewel.beads.layouts.ViewLayout.prototype.layout',it.prototype.layout);it.prototype.g={names:[{name:'ViewLayout',i:Zi,kind:t}]};function
qo(a,b){b=document.createElement(b);return
a.element=b}D('org.apache.royale.html.util.addElementToWrapper',qo);function
jt(){}D(ti,jt);C=jt.prototype;C.handleItemAdded=function(a){a.item.addEventListener(zd,G.j(this.selectedHandler,this,el))};C.handleItemRemoved=function(a){a.item.removeEventListener(zd,G.j(this.selectedHandler,this,el))};C.selectedHandler=function(a){this.model.selectedIndex=a.index>>0;this.model.selectedItem=a.data;this.view.host.dispatchEvent(new
K(K.CHANGE))};C.modelChangeHandler=function(a){G.as(this.Ye,F,!0).dispatchEvent(new
K(a.type))};
C.m=function(a){this.Ye=a;this.model=G.as(a.getBeadByType(Lr),Lr);this.Ye.addEventListener(xd,G.j(this.handleItemAdded,this,Uc));this.Ye.addEventListener(Ad,G.j(this.handleItemRemoved,this,Wc));G.is(this.model,Ir)?G.as(this.model,Ir,!0).dispatcher=a:(this.model.addEventListener(il,G.j(this.modelChangeHandler,this,Xd)),this.model.addEventListener(vc,G.j(this.modelChangeHandler,this,Xd)))};Object.defineProperties(jt.prototype,{strand:{set:jt.prototype.m}});
jt.prototype.g={names:[{name:'DropDownListController',i:ti,kind:t}],l:[po]};function
kt(){}D(tf,kt);kt.prototype.applyImageData=z();kt.prototype.g={names:[{name:'IImage',i:tf,kind:v}],l:[Qp]};function
lt(){O.call(this)}E(lt,O);D(Kg,lt);lt.prototype.applyImageData=z();D('org.apache.royale.core.supportClasses.StyledImageBase.prototype.applyImageData',lt.prototype.applyImageData);lt.prototype.Dl=function(){return
this.model.url};lt.prototype.bq=function(a){this.model.url=a};lt.prototype.Qb=Rl(null);Object.defineProperties(lt.prototype,{src:{get:lt.prototype.Dl,set:lt.prototype.bq},imageElement:{get:lt.prototype.Qb}});lt.prototype.g={names:[{name:'StyledImageBase',i:Kg,kind:t}],l:[kt]};function
mt(a,b,d){a='undefined'!==typeof a?a:null;b='undefined'!==typeof
b?b:null;d='undefined'!==typeof
d?d:!1;J.call(this);this.fields=a;this.compareFunction=b;this.unique=d}E(mt,J);D(Ee,mt);mt.ANY_INDEX_MODE='any';D('org.apache.royale.collections.Sort.ANY_INDEX_MODE',mt.ANY_INDEX_MODE);mt.FIRST_INDEX_MODE='first';D('org.apache.royale.collections.Sort.FIRST_INDEX_MODE',mt.FIRST_INDEX_MODE);mt.LAST_INDEX_MODE='last';D('org.apache.royale.collections.Sort.LAST_INDEX_MODE',mt.LAST_INDEX_MODE);




--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: [EXTERNAL] Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi,

I need more context to help you since "buttonWidths" can refer to some
different components.


El jue, 31 dic 2020 a las 16:34, wkoch (<wa...@boeing.com>)
escribió:

> I just downloaded the nightly build.  My application broke.  It compiled
> but
> in the browser console I see:
>
> SCRIPT5007: Unable to get property 'buttonWidths' of undefined or null
> reference
>
> How do I fix that?
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: [EXTERNAL] Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I just downloaded the nightly build.  My application broke.  It compiled but
in the browser console I see:

SCRIPT5007: Unable to get property 'buttonWidths' of undefined or null
reference

How do I fix that?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: [EXTERNAL] Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
Last time I downloaded I got compilation errors.  I hadn't heard if they were
fixed. I will try again.

The only issue with daily builds is I have applications in production.  I
need backwards compatibility and it's hard making sure every feature works
the same.

Would be nice to know about Build tracking... We never got a response on how
to do that.



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: [EXTERNAL] Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

The problem with sticking with an older build is that you're not getting
the new enhancements we're doing to fix the issues you found or others that
people are working on. For example, the sort bead changed a lot thanks to
your report and is not dispatching the same events after my fixes to
refresh data on item updates. I even had to change things in other parts.

When I was migrating my apps, and even nowadays, I use to build daily at
the start of my day to find possible regression issues and be able to
respond as quickly as possible to them. I think after a 1.0 that will be
easier to stick in a release version, but we're still doing so much work,
so my perception is that it is better to try to keep in the cycle. I'm
seeing great improvements these days at all levels (bindings, compiler,...)
and all of that will help you find less issues.

For example, if you create an example that is not working referring to an
older state of the SDK, it can be working in the actual state, so I'll be
not able to help you on that.

about refreshing in DataGridSort, with my fix, I just need to do "
collection.refresh();", but that's because the bead now extends
EasyDataProviderChangeNotifier and we're overriding
handleDataProviderChanges() to operate for CollectionEvent.
COLLECTION_CHANGED events.

just my 2...



El mié, 30 dic 2020 a las 21:35, wkoch (<wa...@boeing.com>)
escribió:

> I did notice one thing.  I can set the columnWidth=0 and then fire a Sort
> on
> the headerbar.  I can set the column back to the original value and sort
> again.  It all works.
>
> So I'm wondering if there is something in the Sort bead that we could
> hijack
> into a forced refresh.
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

RE: [EXTERNAL] Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I did notice one thing.  I can set the columnWidth=0 and then fire a Sort on
the headerbar.  I can set the column back to the original value and sort
again.  It all works.

So I'm wondering if there is something in the Sort bead that we could hijack
into a forced refresh.  



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

RE: [EXTERNAL] Re: Grid Sort issues

Posted by "Koch (US), Warren R" <wa...@boeing.com>.
I used it exactly as shown in the code right down to the button.  It gave me a strange response.

First time the column was toggled the whole grid except the grid border disappeared.  Then when I toggled the button again the grid contents came back and I could toggle the column.  But the Header button bar did not resize properly.  Instead of using the columnWidth settings it went automatic and shrank everything down.

I probably need to make a simple code package just showing the datagrid and what I'm getting.  I'll see if I can get something done along those lines.

Please keep in mind I am using the SDK from 10/29/2020.  I haven't tried a new one since the last attempt failed.

From: Carlos Rovira [mailto:carlosrovira@apache.org]
Sent: Wednesday, December 30, 2020 1:13 PM
To: users@royale.apache.org
Subject: [EXTERNAL] Re: Grid Sort issues


EXT email: be mindful of links/attachments.




Hi Warren,

I mean that using visible in the column will hide the column but not header button for that column will remain since is part of the header buttonbar, so the for the right way I mean to use the implementation that Greg did. Sorry to not be of much help on this since I don't know much more of that code. But the Column Swapping is working in TDJ, so if it's not working for you we should investigate where is the issue, if is a bug in the code or is something about the way you're using it

Thanks


El mié, 30 dic 2020 a las 17:40, wkoch (<wa...@boeing.com>>) escribió:
I'm not sure what you mean by "not doing it right".  DataGridColumn has a
visible attribute. I just gave it a localId and added buttons to control
visibility.

Yes it was the ColumnSwapping one.  The HeaderBar did not resize properly.



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


--
Carlos Rovira
Apache Member & Apache Royale PMC
Apache Software Foundation
http://about.me/carlosrovira


Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

I mean that using visible in the column will hide the column but not header
button for that column will remain since is part of the header buttonbar,
so the for the right way I mean to use the implementation that Greg did.
Sorry to not be of much help on this since I don't know much more of that
code. But the Column Swapping is working in TDJ, so if it's not working for
you we should investigate where is the issue, if is a bug in the code or is
something about the way you're using it

Thanks


El mié, 30 dic 2020 a las 17:40, wkoch (<wa...@boeing.com>)
escribió:

> I'm not sure what you mean by "not doing it right".  DataGridColumn has a
> visible attribute. I just gave it a localId and added buttons to control
> visibility.
>
> Yes it was the ColumnSwapping one.  The HeaderBar did not resize properly.
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I'm not sure what you mean by "not doing it right".  DataGridColumn has a
visible attribute. I just gave it a localId and added buttons to control
visibility.

Yes it was the ColumnSwapping one.  The HeaderBar did not resize properly.



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by Carlos Rovira <ca...@apache.org>.
Hi,

just checked and the way you are doing is not right. I must admit that I'm
not familiar with that code since it was done by Greg Dove not me. But I'm
looking at the end of that page and there's an example that works ok. The
one called "Column Swapping". I think it is the one you refer to
"toggleColumn". It's working for me right in my latest local build. So you
should check it and if not workin identify why it is not working for you.



El mié, 30 dic 2020 a las 16:26, wkoch (<wa...@boeing.com>)
escribió:

> I tried your toggleColumn function on the "old" SDK.  Did not work properly
> on my DG.  the Header columns didn't resize properly.
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
I tried your toggleColumn function on the "old" SDK.  Did not work properly
on my DG.  the Header columns didn't resize properly.



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Grid Sort issues

Posted by wkoch <wa...@boeing.com>.
Thanks!  I'll give it a go once the build issue is resolved.



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/