Adaugare taburi si grupuri la Ribbon


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!–tab si grup nou–>
<CustomAction  Id="MyCustomRibbonTab" Location="CommandUI.Ribbon.ListView" RegistrationId="106" RegistrationType="List">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Tabs._children">

<!—la tab Sequence e multilplu de 100 impicit –>
          <Tab Id="Ribbon.MyCustomRibbonTab" Title="Tabul meu" Description="Un tab custom" Sequence="501">
            <Scaling Id="Ribbon.MyCustomRibbonTab.Scaling">
              <MaxSize Id="Ribbon.MyCustomRibbonTab.MaxSize" GroupId="Ribbon.MyCustomRibbonTab.MyCustomGroup" Size="OneLargeTwoMedium"/>
              <Scale Id="Ribbon.MyCustomRibbonTab.Scaling.CustomTabScaling" GroupId="Ribbon.MyCustomRibbonTab.MyCustomGroup" Size="OneLargeTwoMedium" />
            </Scaling>
            <Groups Id="Ribbon.MyCustomRibbonTab.Groups">

<!—la grup Sequence e multilplu de 10 impicit –>

              <Group Id="Ribbon.MyCustomRibbonTab.MyCustomGroup" Description="Un grup custom!" Title="Custom Group" Sequence="52" Template="Ribbon.Templates.CustomTemplateExample">
                <Controls Id="Ribbon.CustomTabExample.MyCustomGroup.Controls">
                  <Button Id="Ribbon.TBPR.Nou.RibbonTest1"
                          Alt="Buton de test"
                          Sequence="101"
                          Command="Test_Button1"
                          LabelText="Buton de test 1"
                          Image32by32="/_layouts/Images/RibbonItem/calendar32-add.png"
                          Image16by16="/_layouts/Images/RibbonItem/calendar16-add.png"
                          TemplateAlias="cust1"/>
                  <Button Id="Ribbon.TBPR.Nou.RibbonTest2"
                          Alt="Buton de test"
                          Sequence="102"
                          Command="Test_Button2"
                          LabelText="Buton de test 2"
                          Image32by32="/_layouts/Images/RibbonItem/calendar32-add.png"
                          Image16by16="/_layouts/Images/RibbonItem/calendar16-add.png"
                          TemplateAlias="cust2"/>
                  <Button Id="Ribbon.TBPR.Nou.RibbonTest3"
                          Alt="Buton de test 3"
                          Sequence="103"
                          Command="Test_Button3"
                          LabelText="Buton de test"
                          Image32by32="/_layouts/Images/RibbonItem/calendar32-add.png"
                          Image16by16="/_layouts/Images/RibbonItem/calendar16-add.png"
                          TemplateAlias="cust3"/>
                </Controls>
              </Group>
            </Groups>
          </Tab>
        </CommandUIDefinition>
        <!–aici e template-ul ptr aranjarea butoanelor –>
        <CommandUIDefinition Location="Ribbon.Templates._children">
          <GroupTemplate Id="Ribbon.Templates.CustomTemplateExample">
            <Layout Title="OneLargeTwoMedium" LayoutTitle="OneLargeTwoMedium">
              <Section Alignment="Top" Type="OneRow">
                <Row>
                  <ControlRef DisplayMode="Large" TemplateAlias="cust1" />
                </Row>
              </Section>
              <Section Alignment="Top" Type="TwoRow">
                <Row>
                  <ControlRef DisplayMode="Medium" TemplateAlias="cust2" />
                </Row>
                <Row>
                  <ControlRef DisplayMode="Medium" TemplateAlias="cust3" />
                </Row>
              </Section>
            </Layout>
          </GroupTemplate>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="Test_Button1" CommandAction="javascript:alert(‘Ai dat click pe Button1!’);" />
        <CommandUIHandler Command="Test_Button2" CommandAction="javascript:alert(‘Ai dat click pe Button2!’);" />
        <CommandUIHandler Command="Test_Button3" CommandAction="javascript:alert(‘Ai dat click pe Button3!’);" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>

Anunțuri

Lasă un răspuns

Completează mai jos detaliile tale sau dă clic pe un icon pentru a te autentifica:

Logo WordPress.com

Comentezi folosind contul tău WordPress.com. Dezautentificare / Schimbă )

Poză Twitter

Comentezi folosind contul tău Twitter. Dezautentificare / Schimbă )

Fotografie Facebook

Comentezi folosind contul tău Facebook. Dezautentificare / Schimbă )

Fotografie Google+

Comentezi folosind contul tău Google+. Dezautentificare / Schimbă )

Conectare la %s