How to change the 'No data available in table' text to add an option to 'Create' first record.

How to change the 'No data available in table' text to add an option to 'Create' first record.

MarkAndersonUKMarkAndersonUK Posts: 44Questions: 17Answers: 0

Hi,

I have a number of tables on a page that are in a Parent / Child setup, often when a parent is selected
there will be no child, so the table displays the 'No data available in table' text. What I would like
to achieve is to somehow add an option to 'Create' a new record. Since there are no records, the normal
create icon I use when there is a least one record does not show. Is there any way to make the create icon
show up when there are 0 records ? I don't want to enable the 'NEW' button, as my project is space limited
and so I don't have any buttons enabled.

Below is a screenshot of the layout, where you will see there are 5 child forms, 1 has no data, here is
where I would like to be able to give the user the ability to add a new record.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,391Questions: 26Answers: 4,961
    Answer ✓

    Here is one option:
    http://live.datatables.net/sayesuwe/1/edit

    It uses language.emptyTable to create a button used to create a new record. It uses a delegated event handler for the button. Click 'Clear` to clear the table and see the button.

    Kevin

  • MarkAndersonUKMarkAndersonUK Posts: 44Questions: 17Answers: 0

    @kthorngren, Thank-you so much, this is exactly what I was aiming for. I sure wish I had your knowledge on all this stuff... You don't ever to contract work do you? I could use some help finishing of my project and am happy to pay.. PM me if you do.

    thanks

  • kthorngrenkthorngren Posts: 21,391Questions: 26Answers: 4,961

    No, I don't do contract work. I have enough fun with this stuff for my day job :smile:

    Allan and team might help you. See their support page. PM Allan to see if its something they can take on.

    Kevin

Sign In or Register to comment.