Okay
  Public Ticket #2664564
Styling results and no results view, How to import data in same table?
Closed

Comments

  • Torsten Voll started the conversation

    Hi Aleksandar,

    I moved this to the after-sales section as this is very time-sensitive. My client is seriously nervous and needs me to fix this. 

    I have been using NinjaTables which worked fine on the styling side but the performance was really poor. So that is why I am here. I like the performance but I am having trouble with the styling of the page for my client's customers at http://dm.vollwebdesign.com/service/warranty-check/.

    You can check the results view with this serial number: TZCPG597-000154 and when a wrong on the no-match view so you get a good idea what I mean.

    Thanks a lot for your reply anyway!

    1) So the table is huge (160000 rows currently) and has been created by uploading large CSV or excel files into it with thousands of new rows so adding more data can only be done the same way.

    Is there no easy import option to add more data to the same table?

    My testing website looks like this currently: http://torstenv6.sg-host.com/warranty-test-2/

    Please use is serial for the results-view: DMGHBTR605208UM02831

    2) I guess the error message-view can be styled easily with CSS to make it look like this screenshot (no-results-table.png)?

    7256032284.png


    3) However, how do I convert that horizontal table to look vertically like this screenshot (results-table.png) with all the other styling including this AEG image?

    3247086949.png

    Thanks again for your help!

    Cheers, Torsten

  •  2,507
    Aleksandar replied

    Hi again Torsten

    Did you acquire the Master-Detail add-on? It would allow your users to click on the row (or a button) in the row, and display the rows from the attached image. Those rows would actually be hidden columns, along with the image column that would show the image in the master-detail modal (or page).

    160.000 rows is not that large for manual (imported) tables, so you should have no issues regarding the size. Importing new data, however, is not that easy. You wouldn't be able to create a table linked to the CSV file, because they can handle only smaller tables (up to 3.000 - 4.000 rows), so the only option is to import the table. That creates a manual table which is saved in the database.

    To update the table by importing the CSV file again, you'd need to remove the headers and existing rows, and include only new rows. Then, in the database, find the wp_wpdatatable_# that was created, and then import that new CSV file in there.

    Another option would be to view the table in Excel-like mode in back-end, and then bulk select; copy and paste the data from Excel.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Torsten Voll replied

    Hi Alexandar,

    Thanks for answering my questions.

    I think that this Master-Detail add-on will solve my displaying issue. Not sure how to handle the no-results view with it actually but I will give it a try first.

    Actually, there also is a problem when I create my table from CSV file and then update it via CSV. If there is a value made only of one digit behind the comma like "9.6" your tool converts it to "96.0". How can this be avoided?

    And the import data options you gave me don't sound very "non-geeky" user friendly. My client only wants a simple upload function via a new CSV or excel file for adding data. 

    Isn't there an easier option available?

    And how does he when he uploads more data avoid duplicate records? Can data just be overwritten or will the system tell?

    Thanks Again!

    Cheers, Torsten

  •  2,507
    Aleksandar replied

    Hi again Torsten

    You need to go into wpDataTables settings, and adjust the number format so it is the same as in the CSV file.

    For example, if your numbers in the CSV have a dot as the decimal separator, you need to change the number format to 15,000.00 in wpDataTables settings. Then you should have no issues adding the column as float.

    There's no way of updating the existing table by just uploading the new CSV file. The plugin doesn't have those options yet, so updating it through the database, or copying a range of cells into Excel-like view is the only solution for now.

    The plugin doesn't have any features that would look for existing data, and disable editing if there already exists an entry like that. You can, however edit the email field in the database, adding a unique constraint, like this:

    ALTER TABLE myTableName ADD CONSTRAINT UQ_MyTable_Email UNIQUE (emailColumnName)
    

    And it will not allow anyone to add the same email address if it already exists in the table.

    That is just an example, but that's how it needs to be set in the database.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Torsten Voll replied

    Hey Aleksandar,


    Thanks for the information :-)

    I have now the front-end page styled but still having a few issues.

    You can see it here: https://www.aeg-industrialsolar.de/warranty-check-new/

    You can check the search function using the serial: DMGHBTR605208UM02914

    1) So the error message - I have just added all that text into the file "class.wdttools.php" - looks like this currently:

    7533480148.png

    Is there any way I can format this better maybe with PHP even?

    2) How can I add "required" to the search field so an error is displayed when the field is empty?

    7275344147.png

    3) Is there an easy way to trigger a button click by pressing enter for searching? 

    Thanks!

    Cheers Torsten

  •  2,507
    Aleksandar replied

    Hello again Torsten

    1. Unfortunately, something like this would have to be done as a custom solution. It looks rather nice to me, though. I wouldn't change it one bit. You can use the class td.dataTables_empty if you wish to modify the size or the color.

    2. The only thing you can do here is to add (required) in the filtering label, so it looks like "Serial number (required)", but that's pretty much it.

    3. Not without customization. It would require a custom script that would see "ENTER" as a button click. Unfortunately it can't be done with the built-in features.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Torsten Voll replied

    Thanks Alexandar!

    I have only 2 more questions for you:

    1) How can I download the table? It does not seem to work for me. Via a database dump or is there another trick?

    2) The row ID's on the left do not automatically recalculate when you delete some data. How can I force it to?

    6167974684.png

    Cheers, Torsten 

  •  2,507
    Aleksandar replied

    Hi again Torsten

    1. You can use table tools to download the table in Excel or CSV format. Please note that the table tools can only download what they see, so if you want to export a table that has 20 rows, you will need to display all 20 rows on the page and then do the export.

    2. Unfortunately, there's no way of making that happen. The wdt_ID column is an auto-increment column, which stores the row data, but it can't be automatically recalculated when the row is deleted.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables