[CLOSED] MessageBox render problem

  1. #1

    [CLOSED] MessageBox render problem

    Hi,

    I have some problem with messagebox rendering; If the message is too long, the text is cutted.

    I attach a printscreen.

    I have a view with a button:

                            Html.X().Button()
                                .Text("Cancella")
                                .Icon(Icon.ImageDelete)
                                .Height(30)
                                .Handler("deleteMedia()")
    The javascript is defined as follow:

                deleteMedia = function () {
                    var sel = Ext.getCmp(options.media_grid_id).selModel.getSelection()[0];
    
                    if (sel == undefined) {
                        Ext.MessageBox.alert('Attenzione', "Selezionare il media da cancellare.");
                    } else
                        Ext.MessageBox.confirm("Conferma", "Sei sicuro di voler cancellare il media selezionato?",
                            function (btn) {
                                if (btn == 'yes') {
                                    App.direct.MediaDelete(sel.data.Id, {
                                        success: function (result) {
                                            reloadMediaGrid();
                                        },
                                        failure: function (errMsg) {
                                            Ext.MessageBox.alert('Info', errMsg);
                                        }
                                    }
                                );
                                }
                            }
                        );
                }
    Do you have any workaround or suggestion?

    Thanks

    Best regards

    Andrea
    Attached Thumbnails Click image for larger version. 

Name:	printscreen.PNG 
Views:	8 
Size:	5.0 KB 
ID:	14621  
    Last edited by Daniil; Aug 20, 2014 at 11:42 AM. Reason: [CLOSED]
  2. #2
    You could try somthing like this...

    // Creates an MessageBox..
    Ext.Msg.show({
                    title: 'Your title',
                    msg: '<div>your message</div>',
                    buttons: Ext.Msg.YESNO,
                    icon: Ext.Msg.QUESTION,
                    fn: function (btn) {
                        switch(btn){
                                 case 'yes':
                                     // DO SOMETHING    
                                    break;
                                 case 'no':
                                     // DO SOMETHING
                                    break;
                        }
                    }
                });
    Both the msg and title tag in the code above will be rendered as html, what it means is that you can style or wrap your text in any form of html you want, so you could wrap your text in a div and try to see if that helps..

    I have tested it like this and have no problem getting the text to display correctly
     Ext.Msg.show({
                    title: 'Somthing',
                    msg: '<div>asdlhjasldjasldjasldjasldjasldkjasldkjasldk jasldkjasldkjasldkjasldkajsldkajs ldkasdljasdasdasdasda sdasdasdasdasdasda   sdasdasdasdasdasdasd</div>',
                    buttons: Ext.Msg.YESNO,
                    icon: Ext.Msg.QUESTION,
                    fn: function (btn) {
                        switch (btn) {
                            case 'yes':
                                // DO SOMETHING    
                                break;
                            case 'no':
                                // DO SOMETHING
                                break;
                        }
                    }
                });
  3. #3
    Hi Akpenob,

    I solved using this code:

    Ext.MessageBox.confirm("Conferma", "<div style='padding-bottom: 15px;'>Sei sicuro di voler cancellare il media selezionato?</div>"
    I think that I will do an helper function to wrap messagebox text inside a div.

    Thanks and best regards.
  4. #4
    Yeah think that would be a great idea to do.

    Thank you and best of luck to you to :-)

Similar Threads

  1. [CLOSED] render pid to name problem?
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 24
    Last Post: Dec 03, 2013, 11:36 AM
  2. [CLOSED] render treecolumn problem
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 18
    Last Post: Jul 17, 2013, 3:11 PM
  3. [CLOSED] Render problem with CalendarPanel
    By John_Writers in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Apr 10, 2013, 4:41 PM
  4. Replies: 2
    Last Post: Jun 27, 2011, 10:37 AM
  5. Replies: 1
    Last Post: May 21, 2011, 1:20 PM

Tags for this Thread

Posting Permissions