This topic is locked

How to hide null/empty fields on list page

11/25/2016 10:43:15 PM
PHPRunner General questions
lefty author

I have a grid in freeform mode on one of my tables . I want to hide all fields not filled in on add page to be hidden on list page along with corresponding label on a record on list page if it is empty. There could be numerous fields so I am looking at either javascript which would be very long code or an event . Looking for a start ? Screen shot below . For you golfers out there you might understand a little better . Say one week there is no flight4. I do not want to show any labels or fields for this particular record on list page instead of showing the labels and just a blank space for list page and print page . I guess I could put up with a little whitespace , just trying to eliminate labels/fields showing if empty.
Sample Screen Shot

HJB 11/26/2016

John, rather than to aim to frustrate your targeted solution, I'm looking at the golfer's need

from the ergonomic point of view, not the programming one. Say, there was a web company years ago

which introduced a web page with one single text box in the middle of the page where you were

able to drop a "matchword" to start a search mission in a database to finally display a list.

It worked that fine, they finally went to the stock exchange and harvested $26bn in one go.
Now, with world's best RAD tool in hands, named PHPRUNNER 9.6, the way to the golfer's heart

is truly paved with tons of options to click, in this case, to show up with a start page and

two fields, one is numeric field "week", other is "flight #", all before the built-in feature

named "only reveal database search results on page once entered search criteria is showing up

with found results", say, the user is directly led to page content of his particular interest

and the ergonomic advantage is directly jumping into the golfer's eyes.
May sound a little crazy fro the programmer's point of view, yet the story told in the 1st para

is providing plausible reasons WHY "easy is first" is loved and 2nd more than truly paying back.

lefty author 11/27/2016



John, rather than to aim to frustrate your targeted solution, I'm looking at the golfer's need

from the ergonomic point of view, not the programming one. Say, there was a web company years ago

which introduced a web page with one single text box in the middle of the page where you were

able to drop a "matchword" to start a search mission in a database to finally display a list.

It worked that fine, they finally went to the stock exchange and harvested $26bn in one go.
Now, with world's best RAD tool in hands, named PHPRUNNER 9.6, the way to the golfer's heart

is truly paved with tons of options to click, in this case, to show up with a start page and

two fields, one is numeric field "week", other is "flight #", all before the built-in feature

named "only reveal database search results on page once entered search criteria is showing up

with found results", say, the user is directly led to page content of his particular interest

and the ergonomic advantage is directly jumping into the golfer's eyes.
May sound a little crazy fro the programmer's point of view, yet the story told in the 1st para

is providing plausible reasons WHY "easy is first" is loved and 2nd more than truly paying back.


Sort of understand your answer . Only problem is , that is actually an extra step for the user and will still show fields and labels that are empty . I already have a landing page and the results page like the screen shot also has import feature from other software they use to give another option of entering results. I can't think of another way to show without hiding fields dynamically . I could always add another table , like a results setup table and have different configurations for each tournament and then have child links to the results with different views on list page for each type like one view that always shows only three flights or one view that shows all 4 flights. This is all one record so the problem is , if they import results instead of keying in on inline add/ add page it throws the idea of a result settings page out the window. To make them search first is not plausible . Thanks for the input though. I have been using PHP/ASP runner for about 12 years now and never had the need to hide fields and labels on the list page . I searched forums and only find easier methods that work on view / add / edit pages. You can hide a whole record easily but not part of it.
The only thing I can think of is something like this in javascript on load / before display , but I need an if statement which don't seem to work in list page.
Example for one field.
var ctrlflight4 = Runner.getControl(pageid, 'flight4');
if (this.getValue() === ' ') {
ctrlflight4.on('slow', function(e){
pageObj.hideField("flight4"); // or

$("tr[data-flight4='']").hide();
});

} else {
}

lefty author 11/30/2016



Sort of understand your answer . Only problem is , that is actually an extra step for the user and will still show fields and labels that are empty . I already have a landing page and the results page like the screen shot also has import feature from other software they use to give another option of entering results. I can't think of another way to show without hiding fields dynamically . I could always add another table , like a results setup table and have different configurations for each tournament and then have child links to the results with different views on list page for each type like one view that always shows only three flights or one view that shows all 4 flights. This is all one record so the problem is , if they import results instead of keying in on inline add/ add page it throws the idea of a result settings page out the window. To make them search first is not plausible . Thanks for the input though. I have been using PHP/ASP runner for about 12 years now and never had the need to hide fields and labels on the list page . I searched forums and only find easier methods that work on view / add / edit pages. You can hide a whole record easily but not part of it.
The only thing I can think of is something like this in javascript on load / before display , but I need an if statement which don't seem to work in list page.
Example for one field.
var ctrlflight4 = Runner.getControl(pageid, 'flight4');
if (this.getValue() === ' ') {
ctrlflight4.on('slow', function(e){
pageObj.hideField("flight4"); // or

$("tr[data-flight4='']").hide();
});

} else {
}


Anyone have a clue here? tried above code not! I am stumped on this one, Since it's just part of the record I want to hide/label if empty .

J
joshfolgado 12/23/2016

As far as I know we can only hide empty values on the view page, there is no way to hide fields in the list page.
If anyone knows of a workaround, please post the answer here, would help a lot of us.

jadachDevClub member 12/23/2016

I am using ASPRunner.Net and have done this before.
I set my list page grid layout to vertical.
Then on List Page After Record Processed event I add:
if (data["DataFieldName"] == "") {
record["DataFieldName_fieldcolumn"] = false;

}

else

{

record["DataFieldName_fieldcolumn"] = true;

}
In PHPRunner, you can get ideas from this page: http://xlinesoft.com/phprunner/docs/hide_buttons_in_some_rows_of_datagrid.htm