Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Datatable :
JavaScript
 "columns": [
               { "data": "SupplierId", "name": "SupplierId" },
               { "data": "SupplierPIPCode", "name": "SupplierPIPCode" },
               { "data": "SupplierName", "name": "SupplierName" },
               {
                   "render": function (data, type, row, meta) {
                       
                      {
                   "render": function (data, type, row, meta) {
                       
                       var a = '<a class="action-style"></a><a class="action-style"></a><a>';
                       return a;
                   }, "orderable": false
               }
            ],

function deleteDrugMapping(supplierDrugId, SupplierId, SupplierName) {       
        $("#SupplierDrugMapDeleteDialog").dialog({
            resizable: false,
            height: 220,
            width: 475,
            modal: true,
            buttons: {
                "Yes": function () {
                    debugger;
                    $(this).dialog("close");
                    //window.location.href = url;
                    return false;
                },
                "No": function () {
                    $(this).dialog("close");
                }
            }
        });

What I have tried:

The above code first dynamically creates button onclick event where javascript function "deleteDrugMapping" is called .

Inside "deleteDrugMapping()" dialog box is opened where on Yes button click i get this error , "Uncaught RangeError: Maximum call stack size exceeded."

Error appears as soon as i click Yes button before any further execution of code.
Please help.
Posted
Updated 20-Oct-16 19:16pm
v9
Comments
Nathan Minier 20-Oct-16 8:37am    
Without knowing the CreateTable() function this isn't terribly meaningful, especially if there's something recursive in there.
Abrar Kazi 20-Oct-16 8:42am    
as i mentioned error occurs before the debugger enters the ajax call . as soon as Yes is called it throws the error
Nathan Minier 20-Oct-16 9:37am    
Really looking at it, I'm only seeing some minor syntactic issues; there are a couple of trailing commas that are throwing NULL elements into the mix. I'd get rid of the "data" parameter on the YES function. I'd declare the function as a data member, as it looks to be an object method rather than a flat function.
i.e. "deleteDrugMapping": function(supplierDrugId, SupplierId, SupplierName){

Lastly, if the $.ajax is never being entered I'd have a look and see if you have a global dialogclose event binding that may be getting into the mix.
Abrar Kazi 21-Oct-16 1:17am    
Now i have updated the question there is no ajax call no other methods in dialog box but still when the debugger comes to Yes click i throws the same error.
F-ES Sitecore 20-Oct-16 9:01am    
Your code is getting itself into an infinite recursive loop somewhere, something like;

function myFunc()
{
myFunc();
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900