Tuesday, 22 March 2016

how to open kendo poup in dynamically.

<div id='popup' style='display:none;'>
    <h3></h3>
    <div class="options submitStyle k-button-add"><br /><br /><br />
        <input id="closePopupMessage" type="button" value="OK" class="k-button" />
    </div>
</div>

<script>
$(function(){
 $('#tb').on('click', "a[name='del']", function () {
            var $row = $(this).parents('tr');
            if ($('#tb tr').length == 2) {
                openPopUpMessage("Message", " This record can not be deleted");
            }
});
function openPopUpMessage(title, message) {
            var window = $('#popup');
            window.find('h3').html(message);
            window.kendoWindow({
                modal: true,
                title: title,
                actions: ['Close'],
                width: 500,
                height:200
            });
            window.data('kendoWindow').center().open();
        }
        $('#closePopupMessage').click(function () {
            var window = $('#popup');
            window.data('kendoWindow').close();
        });

});
</script>

No comments:

Post a Comment