How use firebase in datatable
How use firebase in datatable
obsk
Posts: 12Questions: 1Answers: 0
I understand that I need to send key, but when hidden the column, the width dont changes and fits. Help me pls!
This discussion has been closed.
Replies
Not sure I understand your issue. Sounds like you are displaying a hidden table and the columns aren't the correct width. First make sure to have
width="100%"
defined for your table. Second when you display the hidden table usecolumns.adjust()
to recalculate the column width.Is this answering your question?
Kevin
yes, thank you! It's what I need. I have an other question.
I have a product that for some reason when clicking it stores everything and not just one?.
How could I fix it? I'm stuck.
thanks
You'd really need to post a link to a test case showing the issue. Also, I'm afraid I don't really understand what you mean by storing everything?
Allan
Thanks Alan, I have to click on the data in a dataset that is added in imputs to edit them and then add them to another data table, what happens is that when clicking more than once the data is stored together with the Data. Attached How to add the data and the problem.
I want to add only the product you selected and not the previous ones.
It appears that the click event within the double-click event causes it to be stored poorly. Is there any event handler for that?
code:
$('#tabla tbody').on('dblclick','tr',function(){
console.log();
var data=table.row(this).data();
var key=data[0];
var repuesto=data[2];
var modelo=data[3];
var pais=data[4];
var precio=parseFloat(data[5]);
console.log(key,repuesto,modelo,pais,precio);
var inputproducto=$('#productob').attr("placeholder",repuesto+" / "+modelo+" / "+pais).val("").focus();
var inputprecio=$('#preciob').val(precio);
$('#productomodal').modal('hide');
$('#cantidad').focus();
});
$('#agregar').on('click',function(){
var cantidad=$('#cantidad').val();
var prec=$('#preciob').val();
total= cantidad*prec;
var rowNode=facturaadq.row.add([{},key,repuesto+"/"+pais,modelo,cantidad,prec,total]).draw().node();
$(rowNode).css('color','red').animate({color:'black'});
console.log(data);
});
No - PPK of QuirksMode notes:
Reference.
Allan