Home Struts 2 set s:param value in ajax success body
Reply: 0

Struts 2 set s:param value in ajax success body

user1288
1#
user1288 Published in June 20, 2018, 1:26 am

How can I set s:param value in ajax success body? I load a data with ajax call and I fetch it into datatable but when I want to set s:param value I can not get its value, below is my code:

 $.ajax({
        url: "dataPp",
        type: 'POST',
        dataType : 'JSON',
        success: function (res) {
            table = $('table#dttable1').DataTable();
            table.clear();
            $.each(res.dokpp, function(i, item){
                var json = res.dokpp[i];
                table.row.add(
                    [json["kodeDok"],
                    json["fileNameUi"],
                    json["depPenerbit"],
                    json["createdDate"],
                    json["tglBerlaku"],
                    json["tglKadaluarsa"],
                    json["urutRev"],
                    '<s:url var="prev" namespace="/mr" action="prevDasboard">'+
                        '<s:param name="file">'+json["fileName"]+'</s:param>'+
                    '</s:url>'+
                    '<a href="${prev}" class="btn btn-default btn-xs">preview</a>'
                ]);
                console.log(json["fileName"]);
            }); 
            table.draw();
        }
    });

thank you.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306212 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO