Topic: onclick tablegrid

Hello, please i want to show information tablegrid1 in another tablegrid in the same form after onclick in a tablegrid1
Thanks in advance

Re: onclick tablegrid

Can you explain in more detail what you are trying to do?  It's not clear from your post.
Derek.

3 (edited by daamoucheacil 2021-08-15 21:38:18)

Re: onclick tablegrid

Example in the attached photos

Post's attachments

Attachment icon 1.png 26.23 kb, 108 downloads since 2021-08-15 

Re: onclick tablegrid

Second example

Post's attachments

Attachment icon 2.png 26.68 kb, 115 downloads since 2021-08-15 

Re: onclick tablegrid

Hi,
There are a few different ways but this is perhaps the most straightforward (see attached).
Derek.

Post's attachments

Attachment icon daamoucheacil.zip 338.54 kb, 291 downloads since 2021-08-16 

Re: onclick tablegrid

This is what I need, thank you very much
Another question: Is it possible to show the results in TextBox in the same form instead of a table as in the attached image ?

Post's attachments

Attachment icon Sans titre.png 36.38 kb, 109 downloads since 2021-08-17 

Re: onclick tablegrid

Not if there is a one:many relationship as it makes no sense.
But if there is a one:one relationship or if you just want to see more details of the same record that you have selected in the tablegrid, then yes (please see attached). 
There is a small script - it is not necessary but it prevents duplicate records being created (very easy to accidently do when you use the same form).  It also places the cursor in the first edit field if you have chosen to add a new record or to edit an existing record - again, not necessary but just makes it a bit more user-friendly.
Derek.

Post's attachments

Attachment icon on one form.zip 344.43 kb, 252 downloads since 2021-08-17 

Re: onclick tablegrid

Excellent job. Thank you very much. Can this be done after just one click?
Another question please: Is it possible to show the search results directly after typing one letter in the search field without pressing the search button or typing the whole word see the attached image

Post's attachments

Attachment icon Sans titre.png 26.21 kb, 113 downloads since 2021-08-17 

Re: onclick tablegrid

Hi,

Can this be done after just one click?

Yes.  Have a look at Screenshot2 in the attachment. 
Select the tablegrid, select the 'Events' tab and then double-click the 'onclick' event. 
Then, in the script (Screenshot3), write the appropriate code to select the record (in this example, by clicking on form1.button2).

Is it possible to show the search results directly after typing one letter in the search field without pressing the search button or typing the whole word see the attached image

Yes.  Have a look at Screenshot1 in the attachment.. 
Select the search field and in its properties, set the 'filter' property to be %s%
Then set the 'Increm.Search' property to be the button that has the 'search action associated with it.
As a result, as soon as you type something in the search field, the program will automatically start filtering records.
Derek.

Post's attachments

Attachment icon screenshots.zip 375.12 kb, 255 downloads since 2021-08-17 

Re: onclick tablegrid

Excellent, thank you very much, but I did not understand very well the first example of one click, can you explain more please
Another question, please: For example, you have a table with a product of a quantity of 20. I want to create a form that chooses the quantity you want to sell and it automatically reduces it from the total quantity in the table by simply pressing the Save button.
I apologize for disturbing

11 (edited by derek 2021-08-19 22:07:28)

Re: onclick tablegrid

Hi,

but I did not understand very well the first example of one click, can you explain more

The more you do things in a way that is not 'standard' MVD ('single-clicking' and using just one form is not 'standard'), the more you need to write some code to make it work correctly.  It's not a problem, you just need to be aware that this is the trade-off.
Have a look at the attached example.
The script allows you to single-click on a row in the tablegrid and the relevant details are retrieved;  you can also use the 'up' and 'down' arrow keys.  Records are also retrieved using the 'filter' function;  this happens as soon as you start typing something into the 'search' box.
The interaction between 'single-clicking' and immediate filtering of records as you start to type (incremental search) can get a bit complicated.
If you are not familiar with MVD or with its scripting language, just play around with it - try commenting out certain lines of code (use '//' at the start of a line to comment it out) and see the sort of effect that it has.
But sometimes it is easier to start with a more straightforward project and then advance slowly from that point.
Derek.

Post's attachments

Attachment icon all on one form.zip 361.27 kb, 235 downloads since 2021-08-19 

Re: onclick tablegrid

The same thing for the previous attachment. You must double click in the table to show the details, but I want to show it after only one click

13 (edited by derek 2021-08-20 00:23:54)

Re: onclick tablegrid

Make sure that the script tab is showing in the development window otherwise the script will not run (see screenshot).

Post's attachments

Attachment icon script.jpg 141.98 kb, 113 downloads since 2021-08-20 

Re: onclick tablegrid

Yes, there is a tab, but there is nothing new, you must press twice to show the information sad

15 (edited by derek 2021-08-20 10:40:08)

Re: onclick tablegrid

Yes, there is a tab, but there is nothing new, you must press twice to show the information

Then I don't know what else to suggest.
Maybe someone else can download the project and confirm that single click is working.

Post's attachments

Attachment icon all on one form.zip 361.26 kb, 255 downloads since 2021-08-20 

16 (edited by daamoucheacil 2021-08-21 15:56:49)

Re: onclick tablegrid

Excellent, that's what I want. Thank you very much

17 (edited by daamoucheacil 2021-08-22 12:13:32)

Re: onclick tablegrid

Another question please: I have a main form that contains four tables (a main table and three child tables that contain the information of the main table elements by just OnClick)
The main table and the secondary tables derive their information from a second form
The second form contains three tables (the same as the secondary tables of the main form), and each table derives its information from another form.
One of the secondary tables: It derives its information from another form, where this form contains two tables (a table of previously stored information and a table of information that will be stored in the second table of the form 2).
Condition: When every process of adding information to the main table of the first form, all tables are automatically emptied except for the previously stored information table.
See the attached pictures

Post's attachments

Attachment icon screenshoot1.png 180.14 kb, 105 downloads since 2021-08-22 

Re: onclick tablegrid

The second attached picture

Post's attachments

Attachment icon screenshoot2.png 213.93 kb, 108 downloads since 2021-08-22