Is it possible ?
Is it possible ?
Hi i would like to thanks the community for developing this datatable, the examples are awesome and clear.
I would like to ask if something i want to program is possible with datable ?
Look at this example : http://debucquoi.com/images/TABLE.jpg
Is it possible to add a row in the table only if the combination of the codigo and Bodega (wharehouse) don't exist in the table ? I don't know how to make it.
Thanks in advance if you have some advice.
Sébastien
This question has an accepted answers - jump to answer
Answers
I don't really understand what you want I'm afraid. If the codigo and Bodega don't exist, you want a row in the DataTable? What row? Assuming you are using filtering, then the rows shown would be the rows that don't match the filtering.
Allan
Hi Allan thanks for responding me,
The upper form is for adding a row in a tab, but i would like to add a row only if the product (codigo, or Hidden ID) don't exist in the same warehouse (Bodega).
I cannot enter the codigo (Product) two times in the same bodega (Warehouse) with the same datatable, but i can have two distinct lines in order to enter the product in two distinct warehouse in the same datatable
So i would like to avoid adding a row if the "codigo" and "bodega" in the form match some existing combination of codigo and bodega in the tab.
My problem is that I don't understand how to make a search in the tab and exploit the result to avoid adding a new row.
And also is it possible to make calculation in order to have the total of one Column ?
Thanks for your help.
It sounds like you need to add an
if
condition to whatever code you are using to add the new row to the DataTable.Use
rows().data()
to find out what data is in the table and base yourif
condition on that.Yes. Example.
Allan
ALright, i'll do it :)
Thanks for the example, i missed it when a take a look at your documentation. The total is exactly what i need.