E
E
EVOSandru62014-11-20 03:17:48
JavaScript
EVOSandru6, 2014-11-20 03:17:48

How to change behavior of jquery ui dialog using jquery?

Good afternoon, I use Yii for development, such a stone hit my teeth:
I used the CJuiDialog widget (generates dialog from jquery ui). For deployment, I used the articles:

belyakov.su/yii-ispolzovanie-cjuidialog-dlya-sozda... and loco.ru/materials/321-yii-cjuidialog-dlya-sozdaniy... . . But it remained inconsistent there (

The message from the modal is sent, Thanks for sending also opens in the same modal window. There was a nuisance. When you click on the cross in the treasured upper right, nothing happens, there is no error in the console, the window just does not close. I tried it in the file java script write the following command:

// refer to the cross
$('.ui-dialog > .ui-dialog-titlebar > a').click(function(){
alert('123');
$('.ui-widget-overlay, .ui-dialog').css({'display':'none'});
});


Even if I just write alert in a function for an event, then it does not work either on .ui-dialog or on its descendants, only if the descendant has some given id.

for example

$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
        'id' => 'mydialog',
        'options' => array(
            'title' => 'Отправить сообщение',
            'autoOpen' => false,
            'modal' => true,
            'resizable'=> false,
            'closeOnEscape' => false,
        ),
    ));


Here I set id = 'mydialog' and if you hang a click event on it, the alert will work. I tried to get to the cross through the parent starting from mydialog, but again the event does not work out, I suspect that somewhere in the ui library there is some kind of filter for events with its elements, actions without an event over the mfr;t dialog elements are not processed, 3rd I'm breaking my head for a day, help good people!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
EVOSandru6, 2014-11-20
@EVOSandru6

I made a mess like this:

$('#mydialog').click(function(){
        $('#mydialog').parent().attr('id', 'boom');
        $('#mydialog').siblings().attr('id', 'llllllloooollllll');
        $('#mydialog').siblings().children('a').attr('id', 'exit_go');
        $('#exit_go').click(function(){
            $('.ui-widget-overlay, .ui-dialog').css({'display':'none'});
        });
});

Now, when clicking on mydialog, the exit_go ID is assigned to the cross , but for some reason this beautiful thing is not executed without an event, please help!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question