Is it possible ?

Is it possible ?

bastien59bastien59 Posts: 5Questions: 2Answers: 0
edited August 2015 in Free community support

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

  • allanallan Posts: 63,791Questions: 1Answers: 10,513 Site admin

    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

  • bastien59bastien59 Posts: 5Questions: 2Answers: 0
    edited August 2015

    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.

  • allanallan Posts: 63,791Questions: 1Answers: 10,513 Site admin
    Answer ✓

    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 your if condition on that.

    And also is it possible to make calculation in order to have the total of one Column ?

    Yes. Example.

    Allan

  • bastien59bastien59 Posts: 5Questions: 2Answers: 0

    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.

This discussion has been closed.