Jump to content
  • 0
Sign in to follow this  
CraigSZ

Default to Grid Edit without first rendering list view

Question

Hi,

I need a tabular report datapage to open in Grid Edit mode on the initial load/rendering of the datapage as the users will be working with a lot of yes/no fields via checkboxes. I thought that only ticking "grid edit" on the datapage setup would achieve this but the list view is used by default and no edits are possible in this mode. Checkboxes also show as values yes/no instead of an actual checkbox. In-line edit means multiple clicks when the user just needs to select/deselect a number of checkboxes.

I have been able to force my datapage to switch from in-line to grid edit mode (per the Grid Edit by Default post on August 15th, 2016) but the problem I have is that the datapage is first displayed in list mode mode and then the datapage refreshes (when the script kicks in) to change to grid edit mode which is a very poor user experience & doesn't look very good. You can see in the script that it is emulating a "click" of the grid edit link as opposed to opening the datapage directly into grid edit mode. I can reduce the delay from 500 milliseconds but you still see the list mode open and then change to grid edit mode.

I would therefore like to find out if...

  1. Is there a way that the datapage can be immediately shown/rendered as a grid edit datapage instead of switching after the initial load? (either via datapage settings or javascript)
  2. Is there a way to disable/hide the Grid Edit/Exit Grid Edit link that shows by default? i.e. the user would only ever see the grid edit format for this datapage

Would be happy with any methods that provide a clean user experience where the datapage is already set to grid edit mode when they see it.

TIA,

Craig

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I have been able to turn off the "Grid Edit/Exit Grid Edit" link using the script below...

Notes

This only works because of the current grid edit behaviour where the form opens in the list view first otherwise the class name changes when you click the "Grid Edit" link. You need to use the Class Name per the initial form load before entering Grid Edit.

On opening my datapage in list view, I established (using <F12> in Google Chrome) that the Class Name was 'cbResultSetActions....' (full name in script below) so check the Class Name of the item in your own form and update the script accordingly.

The script does the following...

Gets ALL Class Names and puts them into an array

Finds the first instance (hence the [0] as that is the first item in an array) where the Class Name (check your own datapages as may not be the first instance) meets the name of the item to suppress

Suppresses the display as opposed to hiding it {Style.Display = 'none' --> this ensures that no blank space is left where the item would have normally been displayed}

I had to use Class Name as the ID field is dynamically generated by Caspio which tags on unique numbers to the ID each time you refresh the page. I'm sure you could do a partial ID match by taking a substring of the ID but I didn't need to get that complicated.

Insert into Footer section of HTML

<script>
document.getElementsByClassName('cbResultSetActionsContainerCellspacing cbResultSetActionsContainer cbActionPanel')[0].style.display = 'none';
</script>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...