Items without a Value - Hide in Display & Document Generation
Greetings,
I was originally going to reply to this thread (https://my.skybow.com/hc/en-us/community/posts/360007690360-Exclude-list-items-from-document-generation), but with it being 5 years old and my question being slightly different, here we are...
I am wanting to Hide (not Visible) items/columns which do not have a Value. The answer very well might be to .length <>+ # in someway.
Lets say I have 20 image columns...
Picture1
Picture2
Picture3
...
Picture20
Lets say I have 20 short text columns...
CrewMember1
CrewMember2
...
CrewMember20
Display Form - What would be the Visibility method, for each item, to only display items which have a Value (an Image is attached / Crew Member name was populated)?
Document Generation Template - Same question, but for Document Generation. (I suppose this would involve an IF statement, but couldn't find any documentation)
For Document Generation, it would be similar to this, but instead of checking for a Choice Value, check if it has a Value at all:
--- --- --- --- --- --- ---
While trying to find an answer for the above, I ran across these 2 posts:
var webpartId = "YourSubListWebPartId"; var webpartSelector = "[ard-webpart-id=" + webpartId + "]"; var gridController = jQuery(webpartSelector).data('Controller'); var grid = gridController.InstanseData; var itemsCount = grid.GetAllRecordIds().length;
var webpartId="your webpart id"; var webpartSelector = "[ard-webpart-id=" + webpartId + "]"; var gridController = jQuery(webpartSelector).data('Controller'); var grid = gridController.InstanseData.GridControl; return grid.GetSpCsrRenderCtx().ListData.Row.length > 0 ;
These are both older posts, and seem to use the Ardevia syntax...
However, they both look extremely useful, and I was wondering if ya'll could possibly provide updated samples, using the Skybow syntax. (I am guessing they are different.)
Much appreciation as always,
Taylor
-
Hi Kilgore ServiceAccount,
to achieve this you would have to check for "null"
So on the display form on the field or control use the following visible expression (assignment): [[field]]!=null
In the document generator template you can use the [[if]] control as follows:
[[if [[field]] !=null ]]
[[field]]
[[end if]]Kind regards
Matthias
1
Please sign in to leave a comment.
Comments
1 comment