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. Image for the cookie policy date
close icon

Retrieve and Change Dialog Elements on Javascript

Hi,

Would like to know how do I access the dialog elements, such as content, title and etc via Javascript for changing.

We have tried the following, as seems like the model data has changed, but not reflected on the dialog box.

var dialogObj = $("#EditorDialog").data("ejDialog");
dialogObj.model.title = result.d.Name;

dialogObj.open();

5 Replies

KK Kalpana Kandasamy Syncfusion Team September 29, 2014 07:06 AM UTC

Hi Chong,

 Thank you for using Syncfusion Products.

We can access the title of Dialog using “title” property. For adding new content, we can empty the content of Dialog and new content can be placed using “contentUrl”.  Then we can get the replaced tile and content of Dialog control as shown as below,

[JavaSript]

<code>

<script type="text/javascript">

    var dialog;

    $(function () {

        // declaration

 

        dialog = $("#basicDialog").data('ejDialog');

    });

 

    function oncreate() {

        dialog.option("title", "Audi");

        $('#basicDialog').html("");

        dialog.option("contentUrl", "text.html");

    }

 

    script>

code>

 

Note: “text.html” file is available in the project.

 We have prepared a sample based on this and you can find the sample under the following location:

Sample : Dialog Sample

Please let us know if you have further queries

Regards,

Kalpana K

 



KK Kalpana Kandasamy Syncfusion Team September 29, 2014 07:17 AM UTC

 

Hi Chong,

 

Thank you for using Syncfusion Products.

We can access the title of Dialog using “title” property. For adding new content, we can empty the content of Dialog and new content can be placed using “contentUrl”.  Then we can get the replaced tile and content of Dialog control.

[JavaSript]

<code>

<script type="text/javascript">

    var dialog;

    $(function () {

        // declaration

 

        dialog = $("#basicDialog").data('ejDialog');

    });

 

    function oncreate() {

        dialog.option("title", "Audi");

        $('#basicDialog').html("");

        dialog.option("contentUrl", "text.html");

    }

 

    script>

code>

 

Note: “text.html” file is available in the project.

 

We have prepared a sample based on this and you can find the sample under the following location:

Sample : Dialog Sample

Please let us know if you have further queries

Regards,

Kalpana K

 

 

 



CY Chong Yee Mei October 2, 2014 02:18 AM UTC

Hi,

We have tried using dialog.option("title", "titlehere");

But it still does not update to be displayed on screen, the dialog being shown still does not have the new title.


CY Chong Yee Mei October 2, 2014 02:26 AM UTC

It's alright, we found the problem, it seems we must call the open AFTER the setting of property, not before.

Previously, not working:

dialogObj.open();
dialogObj.option("title", activeNodeData.Name);

Now working:

dialogObj.option("title", activeNodeData.Name);
dialogObj.open();


ES Ezhil S Syncfusion Team October 2, 2014 02:26 PM UTC

Hi Chong,

Thanks for your update.

We are glad that your issue have been resolved.

Kindly get back to us if you have further queries.

Regards,
Ezhil S

Loader.
Live Chat Icon For mobile
Up arrow icon