Add record and save csv file ?

Add record and save csv file ?

naltapnaltap Posts: 2Questions: 1Answers: 0
edited October 2017 in Free community support

Hi,
with success i load a csv file from my html page.
It's a very usefull library, many thanks.

Now i would like, have some buttons to add, edit or delete records (row).
Is it possible without web server (.net, ajax, php, ...) with only javascript ?
If yes, the record added or delete is it automaticcaly saved in the csv file ?

Many thanks for response.
Regards
NaltaP

This question has accepted answers - jump to:

Answers

  • Tester2017Tester2017 Posts: 145Questions: 23Answers: 17
    Answer ✓

    Maybe this might give you some answers: https://editor.datatables.net/examples/simple/noAjax.html

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin
    Answer ✓

    In addition to the no ajax example:

    If yes, the record added or delete is it automaticcaly saved in the csv file ?

    If you export a new CSV file using Buttons then yes, it would be included in that. It wouldn't be written into the CSV file on your hard disk automatically though - that would be a massive security issue!

    Allan

  • naltapnaltap Posts: 2Questions: 1Answers: 0

    Hi,

    thanks for your feedback.
    With the example

    $('#example').DataTable( {
    dom: "Bfrtip",
    ajax: "../php/staff.php",
    And with my csv file and not data in the html inner, how to know the name for #example ?
    I'm sorry, but i'm new for this topic.

    Is it possible to have, button for each rows with a pen, trash, ... little picture ?

    Regards
    Naltap

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin

    I don't really understand how your CSV file fits in there. You show ajax pointing at a PHP file. Do you have that reading the CSV file?

    Is it possible to have, button for each rows with a pen, trash, ... little picture ?

    Yes. That example shows text controls, but you could easily just have it show an icon.

    Allan

This discussion has been closed.