No announcement yet.

How to center an sc_ajax_message ?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to center an sc_ajax_message ?

    All is in the title Thank you !

  • #2
    I ask this question because I have a long form with a long scrollbar and when I click on update message (on top of screen), the wait, error or confirmation messages are vertically aligned to the center ... so it's hidden for users.

    I found a workaround : sc_ajax_message that I can not center horizontally now... So I would like to know if someone has an idea to center it.

    Thank you


    • #3
      Just an attempt: did you try adding html code in the message? I havent tried it but it seems likely that this is translated by the browser and hence alignment should work./
      <div align="center">my text</div>

      See also:


      • #4
        no way ! thanks ! an other idea ?


        • #5
          OK, are you ready for this? Here we go.

          Go to Tools -> Layout -> Themes. If you haven't done it yet choose your theme and click on 'Save as' , give it a name and save.
          Click on 'Advanced mode'.
          Open Folder 'Message'.
          Mark the element 'Message'.
          Select the option 'center' from the drop down field 'Horizontal Alignment' and hit the 'Save' button.

          Go to your application under Layout -> Settings. Reload the themes and apply the newly created theme to your app.

          That's it.



          • #6
            Hello jsbinca,
            Thank you very much for these explanations, but, it has had no effect. I did it differently, by overriding the native "scCenterElement" js function like that :

            echo "<script language='JavaScript'>
            function scCenterElement(oElem)
            var ".chr(36)."oElem = $(oElem),
            ".chr(36)."oWindow = $(this),
            iElemTop = 200,
            iElemLeft = Math.round((".chr(36)."oWindow.width() - ".chr(36)."oElem.width()) / 2);

            ".chr(36)."oElem.offset({top: iElemTop, left: iElemLeft});
            } // scCenterElement

            It works perfectly, with what I wanted to do. This thread is solved for me.
            Thank you again

            nb : chr(36) is for "$" character
            Last edited by xof; 07-16-2014, 04:01 PM.


            • #7

              From my works on sc, themes sometimes doesn't apply correctly, I see it even got worse in v8

              However, my 2 cents will be to make express edit and re-chose the modified theme, then in layout, make sure to press that refresh button, after that make a hard reload to your broswer... if works that is good, if doesn't then try to change some other elements in the theme, note that themes (CSS) are very detailed, sometimes you have to try many things to work, such as page, table, label, and there there is background for each one, and also for each app like form/ grid... each one is alone!



              • #8
                Originally posted by xof View Post
                All is in the title Thank you !
                put inside a css div and code.. margin: 0 auto;

                more about centering elements in CSS