
monkeysource
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2016
03:18 AM
focusPercent not firing for merged cells
Hi,
I'm using a MarkupGrid and for each MarkupGrid XML Component I observe focusPercent to apply an effect as focus is gained on each item. This works great until I merge some cells. For any merged cells the focusPercent is not fired at all.
Say I have 2 columns and 2 rows, and 3 content items.
I set item 1 to take up to cells as follows:
x=0
y=0
w=1
h=2
And I set Item 2:
x=1
y=0
w=1
h=1
And I set Item 3:
x=1
y=1
w=1
h=1
Now focusPercent will only fire on items 2 and 3. When I set the focus to item 1 I get no focusPercent events for that item at all.
Any idea why?
Thanks,
Ryan
I'm using a MarkupGrid and for each MarkupGrid XML Component I observe focusPercent to apply an effect as focus is gained on each item. This works great until I merge some cells. For any merged cells the focusPercent is not fired at all.
Say I have 2 columns and 2 rows, and 3 content items.
I set item 1 to take up to cells as follows:
x=0
y=0
w=1
h=2
And I set Item 2:
x=1
y=0
w=1
h=1
And I set Item 3:
x=1
y=1
w=1
h=1
Now focusPercent will only fire on items 2 and 3. When I set the focus to item 1 I get no focusPercent events for that item at all.
Any idea why?
Thanks,
Ryan
6 REPLIES 6

monkeysource
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2016
07:19 AM
Re: focusPercent not firing for merged cells
Hi,
I'm still struggling to find a solution to this one. To me, it seems like a fundamental bug to the grid focus logic. But maybe I'm missing something. Therefore, I have created a sample Channel to highlight the bug which can be found here:
grid-bug-focus-sample
If you run the sample, you'll see it never calls showFocus for cell index 0. I.e. the observer for the focusPercent field is not fired for the item 0 which merges 2 cells. However, it is fired as expected for the other cells.
This is causing a major stumbling block to using the Grid.
Thanks,
Ryan
I'm still struggling to find a solution to this one. To me, it seems like a fundamental bug to the grid focus logic. But maybe I'm missing something. Therefore, I have created a sample Channel to highlight the bug which can be found here:
grid-bug-focus-sample
If you run the sample, you'll see it never calls showFocus for cell index 0. I.e. the observer for the focusPercent field is not fired for the item 0 which merges 2 cells. However, it is fired as expected for the other cells.
This is causing a major stumbling block to using the Grid.
Thanks,
Ryan
Valeriia
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2018
06:48 AM
Re: focusPercent not firing for merged cells
I have the same problem( I use merging cells for hiding empty ones in the first row. Maybe there is another way to do it? I also tried to set numColumns the number of non-empty elements, but it leads to a cutoff of the poster image. Width change does not produce positive results.
joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2018
12:05 PM
Re: focusPercent not firing for merged cells
"Valeriia" wrote:
I have the same problem( I use merging cells for hiding empty ones in the first row. Maybe there is another way to do it? I also tried to set numColumns the number of non-empty elements, but it leads to a cutoff of the poster image. Width change does not produce positive results.
for hiding cells I would first try setting the cell to "visible = false" or "opacity = 0"
aspiring
norcaljohnny
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2018
09:30 PM
Re: focusPercent not firing for merged cells
Adjusting the config.brs and creating a blank cell it now works. (also in main.brs (for i=0 to 3 step 1)
function getGridTemplate() as Object
if not m.gridTemplate = invalid
return m.gridTemplate
end if
m.gridTemplate = [
{
id: 0,
x: 0,
y: 0,
w: 1,
h: 1
},
{
id: 1,
x: 1,
y: 0,
w: 1,
h: 1
},
{
id: 2,
x: 1,
y: 1,
w: 1,
h: 1
},
{
id: 3,
x: 0,
y: 1,
w: 0,
h: 0
}
]
return m.gridTemplate
end function
and you can see in the pic all 3 cells are firing

Cheers.
function getGridTemplate() as Object
if not m.gridTemplate = invalid
return m.gridTemplate
end if
m.gridTemplate = [
{
id: 0,
x: 0,
y: 0,
w: 1,
h: 1
},
{
id: 1,
x: 1,
y: 0,
w: 1,
h: 1
},
{
id: 2,
x: 1,
y: 1,
w: 1,
h: 1
},
{
id: 3,
x: 0,
y: 1,
w: 0,
h: 0
}
]
return m.gridTemplate
end function
and you can see in the pic all 3 cells are firing

Cheers.
Valeriia
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2018
01:17 AM
Re: focusPercent not firing for merged cells
"joetesta" wrote:"Valeriia" wrote:
I have the same problem( I use merging cells for hiding empty ones in the first row. Maybe there is another way to do it? I also tried to set numColumns the number of non-empty elements, but it leads to a cutoff of the poster image. Width change does not produce positive results.
for hiding cells I would first try setting the cell to "visible = false" or "opacity = 0"
I can't do it because of the cell m.MarkupGrid.content.getChild(i) is invalid.
Valeriia
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2018
02:20 AM
Re: focusPercent not firing for merged cells
"norcaljohnny" wrote:
Adjusting the config.brs and creating a blank cell it now works. (also in main.brs (for i=0 to 3 step 1)
function getGridTemplate() as Object
if not m.gridTemplate = invalid
return m.gridTemplate
end if
m.gridTemplate = [
{
id: 0,
x: 0,
y: 0,
w: 1,
h: 1
},
{
id: 1,
x: 1,
y: 0,
w: 1,
h: 1
},
{
id: 2,
x: 1,
y: 1,
w: 1,
h: 1
},
{
id: 3,
x: 0,
y: 1,
w: 0,
h: 0
}
]
return m.gridTemplate
end function
and you can see in the pic all 3 cells are firing
Cheers.
Thank you!!!