Click here to Skip to main content
14,641,056 members
Rate this:
Please Sign up or sign in to vote.
Datatable :
 "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();
}
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 21-Oct-16 4:35am
   
Does it work without "debugger;"? If so it might be some quirk of the browser, try it with a different browser, but if it's a browser debugging quirk there might not be anything you can do about it.
Abrar Kazi 21-Oct-16 7:53am
   
no it does not work without debugger. Yes i tried with mozilla and i didnt get the error. But i want to solve it i cant just leave it like that.
There must be some solution.
F-ES Sitecore 21-Oct-16 8:39am
   
Well I just tried it in Chrome and IE and it worked ok.
Abrar Kazi 21-Oct-16 9:11am
   
What possibly went wrong in my code ?
If I am removing the dialogue box call and just calling Ajax it works fine but when I am calling Ajax inside dilog box button click it prompts the error

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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100