We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

pass information to dialog and recover using KO

Thread ID:





125437 Aug 18,2016 02:08 AM UTC Aug 22,2016 01:15 PM UTC ASP.NET MVC 3
Tags: Dialog
Juan Acosta
Asked On August 18, 2016 02:08 AM UTC

I'm integrating one application with Knockout and Synfusion. 

I have some doubts about the manage of the dialogs. 


I was following this page and I added custom events on OK or Cancel. 

However, the events are not triggered. 

<div class="control">
        Html.EJ().Dialog("basicDialog").Containment(".control").Title("Delete Container Confirmation").
            @<div class="cnt">
                The container will be permanently deleted and cannot be recovered. Are you sure?
            .ClientSideEvents(evt => evt.Close("onDialogClose")).Render();

<script id="sample" type="text/x-jsrender">
    <div class="footerspan" style="float:right">


        @Html.EJ().Button("btn2").Size(ButtonSize.Mini).Height("30").Width("70").Text("Cancel").ClientSideEvents(evt => evt.Click("cancelDelete()"))

    <!--<div class="condition" style="float:left; margin-left:15px">
        @Html.EJ().CheckBox("check1").Text("Dont ask me this again")

        function openDialog() {
        function onDialogClose(args) {
        function confirmDelete(args) {
        function cancelDelete(args) {

I'm calling the open function from KO view model. I was wondering if the events could be tied to the control and get a return of any flag with the user selection. 
ViewModel KO
$(document).on("click", ".kout-delete", null, function (ev) {
        var current = ko.dataFor(this);
        var selection = openDialog();
        if (selection=="OK")

Or if cannot return anything at least, that I can pass the current detail to the openDialog and into the     Html.EJ() .Dialog("dialog"). So, I won't lose the current detail.

Could you help me with this.

Kind regards.


Narayanasamy Panneer Selvam [Syncfusion]
Replied On August 18, 2016 11:45 AM UTC

Hi Juan Acosta,   
Thanks for contacting Syncfusion Support.   
However, the events are not triggered.   
We were able to reproduce this issue with the shared code. This is because you had used Click event name as function in the ClientSideEvents. Please view the code changes in the below code example block:   
Calling the open function from KO view model   
We have prepared a sample with shared code using KnockOut, and the click event is working fine with our dialog control. We have prepared a sample with your requirements. Please find it in the sample link: http://www.syncfusion.com/downloads/support/directtrac/general/SYNCFU~2-2145978064.ZIP    
if cannot return anything at least, that I can pass the current detail to the openDialog and into the     Html.EJ() .Dialog("dialog"). So, I won't lose the current detail.   
To be clearer, opening a dialog doesn’t return any value. Can you please explain the exact scenario on what data you need to pass and which current detail should be maintained? Modify the shared sample based on your scenario and send it to us so that we can provide a solution.   
Narayanasamy P. 

Juan Acosta
Replied On August 19, 2016 06:13 AM UTC

Hi Narayanasamy,

I checked your solution and I found the issue. Also, I could connect to KO without any problems.
One question, could you check this ticket.
The issue is kind of similar.
But the point is how to get the id of the referential object or pass an additional value in the events.
My point is how to pass values with the call reference. I notice the events have to be in the function name only
if I want something like
function confirmDelete(args) {
The event stop working.

Could you give a hand with that.

Kind regards,

Narayanasamy Panneer Selvam [Syncfusion]
Replied On August 22, 2016 01:15 PM UTC

Hi Juan Acosta, 
Thanks for your update.   
how to get the id of the referential object 
We can get the id of current element and  particular element by the following way. 
Code example: 
function onOpen(args) 
  { alert("the corresponding id is :"  + this.element[0].id);            } 
how to pass values with the call reference 
Currently we haven’t provided support for passing value to events. We have added it to our feature request list and it can be tracked through our Features Management System: 
Narayanasamy P. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon