Passing current row data to anchor tag whenever click on that.

Passing current row data to anchor tag whenever click on that.

surendra_srikakulasurendra_srikakula Posts: 4Questions: 2Answers: 0

I am new to the datatables.I have 3 anchor tags in one column.I have to pass "current row data" to that anchor link. Because it calls spring mvc request mapping. How can I work with anchor tag.Please give me answers as soon as possible.

This question has an accepted answers - jump to answer

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    There is an example of putting a link in a cell in the docs:

    https://datatables.net/reference/option/columns.render

  • surendra_srikakulasurendra_srikakula Posts: 4Questions: 2Answers: 0

    Thanks a lot.It works fine.

  • surendra_srikakulasurendra_srikakula Posts: 4Questions: 2Answers: 0
    edited September 2015

    I have another question.

    "<a href='#' id='void' class='void' title='Void' onclick='conformBeforeDelete('/order/updateOrderStatus?orderId=${order.orderId}&userContactNumber=${order.user.userContactNumber}&orderStatusId=10&pageId=1')'><i class='icon16 i-remove'></i></a>";

    In the above code onclick function I write in fnDrawCallback function like below.

    "fnDrawCallback": function () {

        $('.void').click(function conformBeforeDelete(url)
        {
            if(confirm("Do you realy want to delete this Order ?"))
                {
                    window.location.href="${pageContext.request.contextPath}"+url;
                }
            else
                {
                    return  false;
                }
    
        });
       },    
    

    But it is not taking the url. How can I do.
    Please reply me as early as possible.

This discussion has been closed.