Responsive DataTable
Responsive DataTable
Mairinabrandon
Posts: 8Questions: 2Answers: 0
Good day, i have DataTable and i want to update(Change Value) certain cell that is hidden when the screen is small
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
the api provides a method to determine whether the responsive extension has hidden a column in a child row:
https://datatables.net/reference/api/column().responsiveHidden()
You can use this in an event handler e.g. on "draw" to check and change the cell value.
This thread may also be helpful:
https://datatables.net/forums/discussion/comment/164573/#Comment_164573
Also.
cell().data()
will update that cell, whether it's hidden or not.Colin
Hello rf1234 and colin,
How about i have 2 open modal, 1 for responsive table and second modal is for update form for the first modal.
is this still posible to manipulate cell data using the second modal form?
Are you using Editor? Please post a test case as well.
If the second modal is an Editor form please take a look at the Editor api.
https://editor.datatables.net/reference/api/set()
Please refer to this Photo Sir.
Again: Are you using Editor?
No Sir, i don't use Editor.
Then your question about the second modal with your custom form is not Data Tables or Editor specifc. I recommend you post your question with your code on Stack Overflow please.
Alternatively: Just do what Colin recommended take the value from your second modal using jQuery and use "cell().data()" to manipulate the data table.
$('#myCart tbody').on('click', 'tr',function(){
var SelCellData = table.cell(this,3);
})
function UpdateCart(){
alert( SelCellData.data() );
}
this is my code to alert the value of my cell in my datatable.
the result says 'undefined'.
Looks like you are not passing your variable "SellCellData" into your function "UpdateCart()" hence your alert returns "undefined". I can't see where you are calling your function either. Please post a complete test case as per the forum rules.
https://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read#latest
Please use Markdown to highlight your code:https://datatables.net/manual/tech-notes/8