I Want to open datatable's data in a popup

I Want to open datatable's data in a popup

shamishami Posts: 5Questions: 3Answers: 0
edited August 2019 in Free community support

My Script is this:

<script>
  load();
  function load(){
      $("#lostitem tr").remove();
    var row = "<tr><th>Item Name</th><th>Category</th><th>Description</th><th>Operations</th></tr>";
    $("#tbheadli").append(row);
    $("#lostitem").DataTable({
      "ajax":{
        "url":"file.php",
        "dataSrc":"",
        "type":"get",
        data:{fn:"lostitm"}
      },
      "columns":[
        {"data": "Item_Name"},
        {"data": "category"},
        {"data": "Description"},
        {
                data: null,
                className: "center",
                render: function ( data, type, row ) {
                    return '<a href="lostitem.php?resolved='+data.Item_NO+'" class="editor_edit">Resolved</a> / <a href="lostitem.php?delete='+data.Item_NO+'" class="editor_remove">Delete</a>';
                }
        }
        
      ],
      select:true,
      bDestroy:true,
      "fnCreatedRow":function(R,data,index){
        var p =data.Item_NO;
        $(R).attr('lostitem',p);
      }
    });
  }
   $('#lostitem').on('click', 'tr', function () {
        var name = $('td', this).eq(1).text();
        $('#DescModal').modal("show");
    });
</script>

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    Hi @shami ,

    This example comes from a different thread and may be useful.

    If not, 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

  • shamishami Posts: 5Questions: 3Answers: 0
    edited September 2019
  • shamishami Posts: 5Questions: 3Answers: 0

    pop which i using

    <

    div class="modal fade" id="DescModal" role="dialog">

    Job Requirements & Description

    Apply! Close
This discussion has been closed.