Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to set Default option methods in openerp

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 149
    Comment on it

    Options apply standard CSS classes to the snippet. Depending on the method that you choose, the UI will behave differently.

    data-select_class=" class name "
    

    More data-select_class in the same group defines a list of classes that the user can choose to apply. Only one option can be enabled at a time.

    data-toggle_class=" class name "
    

    The data-toggle_class is used to apply one or more CSS classes from the list to a snippet. Multiple selections can be applied at once.
    Let's demonstrate how default options work with a basic example.
    We start by adding a new file in our views folder - name it options.xml and add the default Odoo XML markup. Create a new template copy/pasting the following

    <template id="snippet_testimonial_opt" name="Snippet Testimonial Options" inherit_id="website_less.snippet_options">
      <xpath expr="//div[@data-js='background']" position="after">
        <div data-selector=".snippet_testimonial"> <!-- Options group -->
          <li class="dropdown-submenu">
            <a href="#">Your Option</a>
            <ul class="dropdown-menu"> <!-- Options list -->
              <li data-select_class="opt_shadow"><a>Shadow Images</a></li>
              <li data-select_class="opt_grey_bg"><a>Grey Bg</a></li>
              <li data-select_class=""><a>None</a></li>
            </ul>
          </li>
        </div>
      </xpath>
     </template>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: