In app maker, how can I clear a column sort? - google-app-maker

When app maker creates a table it can make the columns sortable, which is great, but after a user clicks on a column, how can you clear that sort setting to get the table back to either the default settings from when the page first loaded or a specific sort order as in the script below? I am presently using a Refresh button which merely reloads the datasource, but the column sorting remains. Suggestions?
I have tried reloading or navigating back to the page itself, but that had no effect either.
this is the augmented Refresh onClick script that includes the sort order:
widget.datasource.query.sorting.App._ascending();
widget.datasource.query.sorting.Role._ascending();
widget.datasource.query.sorting.Name._ascending();
widget.datasource.load();

Morfinismo gave me the code fragment I was missing, but here's the breakdown:
This will reset any filters and clear out filter fields like dropdowns or suggest boxes:
widget.datasource.query.clearFilters();
This will clear any sorting, so if you want sorting, you will need to add it like so:
widget.datasource.query.clearSorting();
widget.datasource.query.sorting.App._ascending();
widget.datasource.query.sorting.Role._ascending();
widget.datasource.query.sorting.Name._ascending();
which will clear the sorting and reset it to your liking, but will not remove the little arrow graphic on the column heading. For that you will need to navigate back to the page you are already on to refresh it like this:
app.showPage(app.pages.AppRoles);
Here is the complete Refresh button onClick script:
app.showPage(app.pages.AppRoles);
widget.datasource.query.clearFilters();
widget.datasource.query.clearSorting();
widget.datasource.query.sorting.App._ascending();
widget.datasource.query.sorting.Role._ascending();
widget.datasource.query.sorting.Name._ascending();
widget.datasource.load();
This worked for me, but I'm sure there are other approaches and tricks of the trade. Feel free to post them here for future answer seekers.

Related

Google Tag Manager - Help setting up tags to track play button clicks and timestamps

Was wondering if someone could help me out or provide some guidance with some things I'm looking to do with Google Tag Manager.
I'm fairly new to GTM but I've already got two basic tags set up:
Track All Page Views
Track all Link Clicks
I've got the above two working and sending data to my Google Analytics account.
What I'm having trouble with is the following:
My website has a bunch of single pages that each have an audio player on them. I would like to track when a user does the following:
Clicks the Play Button
Clicks the Download Button
On top of that, I would like to:
Track the timestamp of the song when a user clicks the Pause Button or exits the page.
Here's an example of one of the pages I would like to implement these tags on: https://www.jimmypressplay.com/mashup-last-friday-night-i-wanna
For #1 and #2, I've tried a bunch of things with no success. I've messed around with the "Click - All Elements" and "Custom Event" Trigger Types and I've set the trigger to fire when the click element matches the div/button class of the play button. I've also messed around with setting up a custom variable (by using either the "Auto-Event Variable" or "DOM element" options). But none of that seems to work (but obviously I am probably doing something wrong).
For #3, I haven't tried tackling that yet, but I've noticed in the code in the "slider slider_is-active" div class it has an element ("aria-valuenow") that keeps track of the current timestamp, so I'm guessing there should be some way to return that timestamp if I am able to set it up as a custom variable somehow.
If anyone has some free time and could take a look and point me in the right direction, that would be great! Or if I need to provide more info, let me know.
Thanks!

I need to display a pop up table on clicking a button in vb.net. How do i do this without the gridviews just on plain button click?

I need a table to pop up or flash on the users screen when a button is clicked
It is a reference table, users can go back and check the codes while filling a form. This is to be done vb.net. Please help me i need the simplest solution possible
in my opinion:
1) If you don't insist on formatting and you would like to only display table data, you can simply write the data into string, which you will display in a MsgBox dialog. You'll probably will have to take care about partial string lenghts in columns (trim, or complete with spaces to a specific length) and then it will look OK. Bellow is an example of such data (only a test dialog) without any trimming/completeng:
2) For a serious table, you'd have to either use datagrdiveiw (or such) in a separate form, or draw your table using GDI, which would be a rather complicated and eccentric method.

AspxGridView: Unable to sort without SortCount at the beginning

I'm using ASPxGridView with its default sorting property.
Before, it was not viewing any record after I press to any column name for sorting. But(there's a view all button) after I click to "View all", it was coming in a sorted way.
So I've figured out that I had to Bind grid again if (ASPxGridView1.SortCount == 1).
Now it's working, but only at the beginning, when I click to any column name for sorting, it returns no record, then it works perfectly.
So I need to do something instead of SortCount when the grid loads for the first time.
What could it be?
I do not know your code, but I think that the solution to this issue is discussed in the
Why might paging (sorting, grouping, filtering) not work in the ASPxGridView?

Need tips for better usability for tabular data with pagination

Just another day i found myself writing code to show data on the UI.
I am again using DataGrid/GridView (ASP.NET),
User Id as link button (clickable) to redirect user to another page.
User having hard time to find where to click(Though the link has underline and hand pointer as usual on hover)
just another common table like structure
Following are the columns for example,
User ID (Link button), User Name, First Name, Last Name, Date Of Birth
Now i would like to make it better form the usability point of view. Can someone suggest a good link, example or suggestions to make it better.
Thanks all,
how about changing the user id column to a button to make it more clear that it's clickable?
you could also add a new button/link column that says "edit" or "view" instead of making the user id the link to the next page.

Semantic markup to achieve last row editable effect?

I'm looking to have a table that can be added to by just typing into the last row and clicking on the "Add" button at the end of the row. All other rows in the table can be deleted by clicking on a button in their rightmost column.
My problem is that forms can't wrap only one row and validate as XHTML. If I make the form wrap the entire table, it'll include the rows which have a form as their last cell too. And forms within forms are definitely not valid.
Suggestions?
Thanks for clarifying the situation. The way I see it you have a few options here:
Are you using (can you use) JavaScript? If so, you can easily modify the submission URI based on which button was pressed. You can thus get rid of all forms except for table-wrapping one.
Alternatively, depending on your requirements, you may be able to replace your "delete" buttons with links (possibly styled like buttons) in which case you won't need forms to wrap them. Note that this approach does not require javascript UNLESS you need to handle a situation when someone begins to fill last row and then clicks on "delete" on some other row and you want to preserve incomplete changes made to last row inputs. In this case you'd still need to use javascript to submit the form so #1 above would probably be better.
Bite the bullet and submit to the same URI. Distinguish what button was pressed by button name. You can always redirect to appropriate URI at that point.
Make your peace with non-validating html :-)

Resources