Crud with Edit within the table itself and search for data + database

0

Could someone tell me a way to do a CRUD with editing by the table itself? I want to be able to do this, but I do not know how to do it.

the person enters the page where the data is displayed click on the table cell, edit the wrong data and READY, save the data from it, can not have buttons or redirection to other pages, all on a single page ... to breaking my head, I tried to JQUERY more I will be sincere I do not know to link with my database or to do the search.

I know a little of PHP, but it was not enough.

Someone could teach me, show me a video, show me anything, help, jobs can be in the game.

    
asked by anonymous 08.02.2018 / 15:59

1 answer

0

There is a lib called Bootstrap Table , I use it in all my projects, I think it's fine documented and easy to use, there is an extension of it that has exactly what you want here . I will leave an example of the implementation of lib normal, I have never used this extension to edit information straight from the cells.

First you create a table and give id to it:

              <table class="table" id="table">
                <thead>
                  <tr>
                    <th data-field="id" data-visible="false">ID</th>                       
                    </tr>
                  </thead>
                </table>

This data-field will be the name of the attribute that the table will receive. For example, you return a json with the list of people, and the person object in your php will probably have a id , putting data-field="id" you're saying that in that column% / p>

Java Scrpit:

$("#table").bootstrapTable({
  ajax: urlQueVaiDevolverAListaDeJson,
  search: true, // se true, cria cria um campo de busca, e implementa a busca sozinho
  sidePagination: "client",
  pageSize: 5, // quantidade de itens por pagina.
  pagination: true // se true, cria uma paginação por você
});

Anyway .. this is .. this is the basics about id , it does a lot for you .. search .. pagination .. and etc. I suggest you study it, and the extent of what you want.

    
08.02.2018 / 16:15