Default behavior of a tableview is to highlight in blue a selected row.
I have an edit/delete (not sure on the wording yet) button that puts the table in edit mode, showing the red delete circles.
I'm unsure about how or even whether to let the user edit the text of a row. (Although until now "whether" hasn't even crossed my mind.)
Is it better to let the user add and delete items, or should I include an edit function?
If I should include an edit function, should it be triggered by the same edit function that makes the delete circles appear, or should editing be enabled by another button (limited space for buttons) or even a fancy gesture?
I would say limiting the user to add and delete but not edit would depend on your use case and what a row of your table represents. If it's a small piece of information (say a name) then it may be more sensible to just delete the wrong one and enter a new one rather than edit. If the row represents some larger object, then edit would probably be a good idea. What I would recommend to get that done, is pushing to some detail view controller when the row is tapped which would have it's own edit state and allows the user to change whatever they want with that object (like how the contacts app works).
Related
First steps with PaperJS. I realized this sketch and this video to describe the issue. As you can see in the video, drawing, for example, three items, and moving over them to select one and pressing the "d" key on keybord, it is possible to remove just the last added and selected item, but not the previous ones. If you start from the first or second item of the three added, the alert is not even triggered.
The wanted beaviour would be instead to select the event.item.selected (moving on it with the mouse) and remove just the selected one by clicking the "d" key on keyboard.
Thank you for your help
Your issue is that after removing the first path, your path variable no longer points to nothing.
So the next time you hit the delete key, you no longer know the selected path.
What you should do instead is storing the currently selected path into another variable and use it instead.
Here's a corrected sketch based on your code, demonstrating this.
I have a spreadsheet in google sheets that has a lot of checkmarks:
I want to create another checkbox filtering system, either at the top, if possible, or on another tab if not. I've tried putting the filter at the top, but as I'm sure you know, it overwrites the data, so no bueno. I also tried this:
with this code:
=FILTER(Movies!A3:P1000,(IF(F2=0,Movies!F4:F1002=0,Movies!F4:F1002=1)))
Which doesn't seem to be doing what I want either? It's showing a random selection, it seems, rather than only the data with the F column being true.
Ideally, you click the checkmarks of the data you want to see, so, if you click the check under Andrew, Addison and Richie, it would only show the rows that had only Andrew, Richie, and Addison's checkmarks. I am fine with making the checkmarks a 0,1,2 list if needed. (Because checkmarks I think are only binary, unless they have an option somewhere to have a third option that I'm unaware of, and marking some data to not be seen if it doesn't have a checkmark would likely require a third option.)
this is what I've got
I'm stuck on this one, and after a number of google searches am now wondering if I'm the only person who's ever tried to do this.
I have a google sheet that users are required to fill in. There is a drop-down selection option at the top, specifying the region the user needs the file for.
However, as the user gets down to the lines for the individual items required, some (a small number) may not be for the region selected at the top.
So what I'm trying to do is add the regions to the individual lines. The default for each line should be the region selected at the top, so this should show as pre-selected. But I want the user to be able to still click on a drop-down arrow and select a different region for a line.
Does anyone have any ideas on how to do this? Thank you!
Okay,
I'm unsure of your expected outcome, your request is also not very clear -
What I've done is created a list via Data validation, however, if a user enters data into the adjacent column:
https://docs.google.com/spreadsheets/d/1OsrQCUt-Urf_Gx8_l9CBZkaUlDc311-S-0csa9GAtCQ/edit?usp=sharing
also it's good practice to share an example of your workbook for others to edit and work on.
let me know if this is what you wanted.
I seem to have a mental block with this one.
I need to save recent changes to a Record. I am doing it OK with buttons for "New" "Edit" "Post" "Next" etc but when a user double-clicks a DBGrid, it is now too late to make changes as the DBGrid selection has moved the database cursor to the selected record.
I can't use AutoUpdate as the data that may have been changed is not something the user would have directly entered, it is a value that is changing all the time.
I'll try to describe it better: While the user is reading a Test-page, a timer is counting down or up. When they click the "Next" or "Prior" buttons I can save the timer setting. But, if they Double-Click the DBGrid I have no way of first changing the current Record before the selection moves to the clicked-Record.
I tried using the
Procedure TForm1.tblTestOnBeforeScroll(...
begin
tblTest.Edit;
tblTest.FieldByName('TimerCt').AsInteger:=ClockCtr;
tblTest.Post;
end;
But, that crashed the database, not surprisingly, but I thought I would give it a try before asking here.
How do I deal with the current record? I do not want to disallow the double-click if possible as it seems nice and intuitive for the user.
I'm afraid that what you do on DBGrid is a wrong in concept action.
Key point is DBGrid is a data aware control. So everything you do on it must based on it's datasource then it's dataset.
There is a DblClick event on TDBgrid. But still you have to check it's dataset to see what record is active.
The code you shown above clearly lead you to an endless loop.
When you doing a scroll, the dbgrid will call OnBeforeScroll event, moving the active record
and call OnAfterScroll. Your OnBeforeScroll code does an data update. Then dbgrid abort its operation cause of data change. Then after data update, it try to scroll again, and the data change happen again. Endless loop happen here.
best regard
Apologies in advance if I'm misunderstanding you, but it seems to me that either the premise of your question is wrong or there is something relevant you haven't told us about what you're doing. Please try the following:
If you don't have one already, please temporarily add a DBNavigator to your form and connect it to the same DataSource as your DBGrid. The point of doing this is so that you can more clearly see what's going on.
Then, in your DBGrid's Options, set dgEditing to True.
Finally, comment out or disable your BeforeScroll handler, save and run your program.
Now, click once in some cell in your DBGrid that contains a value which it's ok to change. Click it a second time so that it selects the value in the cell rather than the cell per se.
Make some change to the cell value, but do nothing else for the time being. You should notice that a) the current record indicator of the DBGrid has changed from a black triangle to an I-Beam graphic, like ][ and b) that the tick and cross buttons of the DBNavigator are now enabled.
Now, without doing anything else on the form, click in another row of the DBGrid. You should find that a) the change to what was the current record in step 5 has been saved and b) the current row indicator reverts to the black triangle and the DBNav's tick and cross buttons are disabled.
(If you don't get the behaviour I've just described, create a minimal new project and try that instead, as some other change you've made in your existing project may be interfering with it).
What I've described in 5 & 6 is the default behaviour of a DBGrid and insofar as I understand your q, that seems to be the behaviour you're trying to achieve. If that's not the behaviour you want, please explain exactly how what you do want differs. It's not clear to me where the user double-clicking on the grid comes into your q, except that that action may move the dataset's cursor (if the dbl-click is on a different row than the current one), but as the default DBGrid behaviour will save changes to the current row before it moves the dataset's cursor, it will do what you seem to want automatically.
Btw, what "AutoUpdate" do you mean? Did you mean TDataSource's AutoEdit property?
My question is very simple but I really didn't find any solution here.
I have a Table setSelectable(true), setMultiselect(false), setImmediate(true).
It works fine by first click and moving through the table using arrows.
But if I click again to the row already having been selected,
then it becomes unselected. How to prevent it?
I'd like to have kept just one row always selected.
As from the Vaadin Book here:
If the user clicks on an already selected item, the selection will deselected and the table property will have null value. You can disable this behaviour by setting setNullSelectionAllowed(false) for the table.
So:
table.setNullSelectionAllowed(false);