Issues with pullToAction in ShinobiGrid


#1

Im trying to use the PullToAction, but I have issues.

self.myGrid = [[ShinobiDataGrid alloc] init];
    self.myGrid.delegate = self;
    self.myGrid.dataSource = self;
    self.myGrid.selectionMode = SDataGridSelectionModeRowSingle;
    self.myGrid.defaultRowHeight = @60;
    self.myGrid.defaultHeaderRowHeight = @40;
    self.myGrid.numberOfFrozenColumns = 1;
    self.myGrid.scrollEnabled = YES;
    self.myGrid.bounces = YES;
    self.myGrid.alwaysBounceVertical = YES;
    self.myGrid.showPullToAction = YES;
    self.myGrid.pullToAction.delegate = self;

When there are no rows in the grid, the pullToAction cant be triggered. I tried overriding the contentSize of the grid in didFinishLayingOutShinobiDataGrid: but it is not setting it.

The other issue, the PullToAction component does not show anything (No arrow, no animation, none of the text for states). It is working because I get the pullToActionTriggeredAction: delegate method called, but nothing is showing up.

Any ideas???

Thanks

Rodrigo García


#2

Greetings Program!

You’re not seeing the arrow animation because you have a frozen column. I’m not sure if there is a workaround for this other than maybe attempting to add your own arrow/animation to the view below the header of the other columns…

When your datasource returns no records, what you could possibly do is add a placeholder record with empty values so that the the grid can at least be pulled down to reload new data.

Wg


#3

Hi Rodrigo,

Thanks for getting in touch!

I can confirmed these issues in our Grid component & I have raised these issues with our developers.

Regarding Wizgod’s work around solution, this should work as long as you set the one cell’s height to be the height of the grid & set it’s background colour to clear so it looks like the background of your grid but with the Pull To Action functionality.

Let me know if you have any questions.

Kind regards,
Andrew Polkinghorn


#4

Hello,

I solved the issues with wizgod workarounds.

Added the placeholder row with the height of the empty space so the pullToAction could be triggered.

I also added my own pullToRefreshView to the pullToAction’s scrollview.

BUT I found another issue  smiley cry

If I scroll up and down or pull to refresh, I cant scroll sideways.

If I scroll sideways, I cant scroll up and down or pull to refresh.

What can I do?

Thanks,

Rodrigo García


#5

If you can post the code for your pullToRefreshView, I’ll see if I can replicate it and see what’s up.

But one thing it could be is the height (or width) of the scrollView content size gets locked to whatever size the view is at the moment you scroll left/right (or up/down). If this is the case then it’s a matter of changing the content size.

Wg


#6

wizgod

If you can post the code for your pullToRefreshView, I’ll see if I can replicate it and see what’s up.

But one thing it could be is the height (or width) of the scrollView content size gets locked to whatever size the view is at the moment you scroll left/right (or up/down). If this is the case then it’s a matter of changing the content size.

Wg

The problem was indeed related to the contentSize.

If the contentSize does not fill the entire available Y space, this problem occurs.

For example, iPhone 6 screen in portrait is 375x667. Status Bar height is 20 points and NavigationBar height is 44 points (in portrait mode), so I have 603 points of height available. When the placeholder row was needed, I was miscalculating the height of it.  So the placeholder row was added to the grid and the final contentSize of the grid was 600 instead of 603.

So for the pullToAction to work perfectly (just like in a TableView), the height value of the contentSize of the grid must be equal or greater to the frame’s height of the grid.

Thank you!