After using server side Pagination Modal box is not opening from on click?

After using server side Pagination Modal box is not opening from on click?

Archana26Archana26 Posts: 3Questions: 1Answers: 0

{
"targets" : 4,
"data" : "ideTransactionType",
"render" : function(data,
type, full, meta) {
return '<a href="#myModal" data-toggle="modal" id=\''+ data + '\' onclick="deleteType(this)">'
+ '<img class ="icon" src=\'/Dashboard_TPV/images/delete.png\' height="60%"></a>';
}
}

Answers

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    Herd to say without actually seeing the page. Do you get errors in your browser's console? Is the function deleteType(this) being called?

    If you still have issues then please post a link to your page or a test case replicating the issue.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • David@QuantumDavid@Quantum Posts: 36Questions: 4Answers: 2

    Hey @Archana26 ,

    Try looking at the element on the web-page in the browser (I'm assuming Chrome as browser platform): F12 key>Elements>Find the table cell with the <a> link or right click on the link and click the inspect option, to check the string has formatted correctly.

    Let me know if that doesn't help,
    David

  • Archana26Archana26 Posts: 3Questions: 1Answers: 0

    There is no error in console.
    I have pasted the js and html

    This a serverside pagination. Where I call spring application and get data. I am using Thymeleaf in frontend.

    I have pasted the code here.
    https://codepen.io/Archana26/pen/eYYvWqL

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    Is the function deleteType(this) being called?

    You didn't answer this question. Place a console.log statement in the function to see if tis called. If its called then you need to debug that function.

    Kevin

  • Archana26Archana26 Posts: 3Questions: 1Answers: 0

    Hi The problem got resolved. the order of the js files had been changed by someone. I reorder them and it worked.

    Thanks for your quick response.

This discussion has been closed.