DbPro wish item, or maybe a plugin?? - Forum

Forum Navigation
You need to log in to create posts and topics.

DbPro wish item, or maybe a plugin??

So I have been mulling this over for a while. Ultimately this would be amazing. I have been looking into possible ways to use an html page inside a browser object to get this effect but I havent yet come up with a way. I am really wanting to get a sortable grid attached to a database. This would be an amazing feature to add to the already amazing DbPro plugin. Here is an example of what I am trying to accomplish.

https://jqueryui.com/sortable/

would love to see a command in DbPro like dbpSortableRows "Rectangle1" "True". I know that asGrid has sortable rows, however to attach that to dynamic data from a database table would be a nightmare if its possible at all. Could be accomplished by creating a secondary table like an index with the sort data. So if you have a table named cars, and you use the sortable command it would create a table named cars-sortorder or something like that. Man I wish I knew Delphi better to make plugins.

I would most definitely pay for something like this if it could look as good as the example in the link.

Hi Matt!

Is the dbpSort command not what you need?

Hi Vadim,

dbpSort is limited to working with data in a field that is already present. Lets say like a field named SongID. I can have the table sort the records by that field. But lets say I don't want them in that particular order. I was really looking for a way my users can sort the results of a query any way they want.

The Application: I am making a set list app for musicians. They can add songs (with Artist, Song, Lyrics, PDF etc in the table) When they get to the show they can adjust the order of the songs they will be playing that night by dragging them up or down the list. I have a complete app but without that feature I dont want to release it. My main competitors application has this feature and my testers have unanimously said that is a feature they would want in the app.

Let me include the app in a zip file here. It is free to sign up so you can add new songs from the song bank. This is just for testing so I ask to please not share it.

I would love to get your opinion Vadim, maybe if Andrei (@as3856) has a minute to test it out and provide some feedback, that would be amazing. Maybe Luis could make a beta testing board where users can beta test other users applications? I dont know that may pose a lot of security issues.

Uploaded files:
  • You need to login to have access to uploads.

@mazzu001

The Application: I am making a set list app for musicians. They can add songs (with Artist, Song, Lyrics, PDF etc in the table) When they get to the show they can adjust the order of the songs they will be playing that night by dragging them up or down the list. I have a complete app but without that feature I dont want to release it. My main competitors application has this feature and my testers have unanimously said that is a feature they would want in the app.

I think that trying to make the grid in NeoDBPro do this would require a huge amount of work (akin to adding a second (underground) basement on an existing house).

But, if you are seeking a specific solution to the afore mentioned problem, would a satisfactory solution be to ...

a) have an additional field/column in the table/grid where the users could enter the order number and then have NeoDBPro sort it on this field/column ? ... note that this value does not have to be 1, 2, 3 etc. ... can be 100, 200, 300 etc. thus enabling simple ability to insert between two songs (e.g. 250)

b) have a set of buttons (up, down, first, last) that move the current record/row in the specified direction ?

c) provide this functionality within a BrowserObject display ? ... html/css/javascript already do this with minimal effort

I am assuming we are dealing with 15 to 30 songs at a time.

Rows are easy to drag and drop in the asGrid 2.0 table
You just need to bind the table to the database.

Andrei (as3856)

Quote from as3856 on February 12, 2020, 9:01 pm

Rows are easy to drag and drop in the asGrid 2.0 table
You just need to bind the table to the database.

Andrei (as3856)

I will definitely check that out deeper. I didnt know you could bind the asGrid to a database!! I will look into it more. Thanks Andrei

In the meantime I found a work around that wasn't too painful. This is specifically for mdb or access database. But the same could be done with SQL commands

I added a column to the table that is auto increment (But not a key) named songpos and I added this code to a button. 9999 is a temporary number and is meaningless. It didn't work if I left it blank so I had to enter something. And any musician that knows 9999 songs is probably not from this planet anyways :)

Up Button

SetVar "[newpos]" "[SetLister.[selectedlist].songpos]+1"
SetVar "[oldpos]" "[SetLister.[selectedlist].songpos]"

SetVar "[SetLister.[selectedlist].songpos]" "9999"
dbpFind "SetLister" "[selectedlist]" "songpos" "[newpos]" "ExactMatch=No;CaseSensitive=No"
SetVar "[SetLister.[selectedlist].songpos]" "[oldpos]"
dbpFind "SetLister" "[selectedlist]" "songpos" "9999" "ExactMatch=No;CaseSensitive=No"
SetVar "[SetLister.[selectedlist].songpos]" "[newpos]"
dbpRefresh "SetLister" "[selectedlist]"
ShowObject "songslist" "Fade" "5"

Down Button

SetVar "[newpos]" "[SetLister.[selectedlist].songpos]-1"
SetVar "[oldpos]" "[SetLister.[selectedlist].songpos]"

SetVar "[SetLister.[selectedlist].songpos]" "9999"
dbpFind "SetLister" "[selectedlist]" "songpos" "[newpos]" "ExactMatch=No;CaseSensitive=No"
SetVar "[SetLister.[selectedlist].songpos]" "[oldpos]"
dbpFind "SetLister" "[selectedlist]" "songpos" "9999" "ExactMatch=No;CaseSensitive=No"
SetVar "[SetLister.[selectedlist].songpos]" "[newpos]"
dbpRefresh "SetLister" "[selectedlist]"
ShowObject "songslist" "Fade" "5"

With some fancy showobject and hideobject actions its not too bad. You cant drag and drop to a new location in the list but you can move it up or down one increment at a time with a button.

Quote from Gaev on February 12, 2020, 7:30 pm

 

I am assuming we are dealing with 15 to 30 songs at a time.

Around there. My band has a repertoire of about 50 songs. Never more than 40 per show. Depends how many sets we are being payed for. But yes not that many. Implementing a webpage  from a Web Browser object with links to VNWin commands would be horribly difficult, although possible as far as I can think.

 

I found a work around that is good for now. Although I am going to look into asGrid deeper. The ability to adjust the appearance of the grid is very important here as the demographic is the general public and lets face it. They want "pretty".

Quote from as3856 on February 12, 2020, 9:01 pm

Rows are easy to drag and drop in the asGrid 2.0 table
You just need to bind the table to the database.

Andrei (as3856)

It is also important that any changes in row location be saved so it is the same the next time they open that set list. Can the grid save the table? (Each set list is its own table)

It is also important that any changes in row location be saved so it is the same the next time they open that set list. Can the grid save the table? (Each set list is its own table)

YES.

 

Andrei (as3856)

 

 

Now I understand. You need the ability to arbitrarily swap lines with drag and drop. Simple sorting really doesn't work.

asGrid really allows you to drag rows and swap columns with the mouse (without visualizing the drag and drop process).
In order for the rows to be draggable, this setting must be used:
asGridOptions "Rectangle1" "RowMoving" "True"

I tried to run the setlister.exe program, two alert boxes about the wrong key in the registry appeared sequentially.
The window has opened, and what to do next? I do not know how to use it. Apparently some help is needed for the program?

It looks nice to the eyes! Handsomely!

Uploaded files:
  • You need to login to have access to uploads.

Best I could do for now is a small getting started video. It goes over the steps for getting a set list together. I am going to work on a tutorial web page tomorrow.

https://youtu.be/bl0n5ToIzVk

So I will look into the system registry error. I have a good idea what I am looking for. When you sign in there is a "remember me" option. If thats checked it writes your email and password to the registry to retrieve the next time you launch the application. So obviously I have a procedure to check those registry entries at start up. I need a handler if the registry entries are empty I am guessing. Will look tomorrow. If you check "Remember Me" when you log in I suspect it wont give those errors as the registry entries will be there.

Thank you very much for the input Vadim!

@as3856

How do I bind the grid to a table?

A plugin with this grid cannot be attached to the database. Can be downloaded from the database.

Regards

Andrei (as3856)