This is a migrated thread and some comments may be shown as answers.

[Solved] PanelBar expand bug

4 Answers 31 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dmitry
Top achievements
Rank 1
Dmitry asked on 14 Nov 2010, 05:34 PM

Hello! Thx for your MVC components, they are great!

But, I've noticed some strange behavior when using PanelBar items content() method in some other content() method(for example tabstrip content). When the page is loaded - the state of the panel item is not expanded, but if insted of content i use item it works as it should

here is code sample

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<% Html.Telerik().TabStrip().Name("MyTabs")
       .Items(tabstrip =>
                {
                    tabstrip.Add()
                        .Text("test")
                        .Content(() =>
                        {
                            Html.Telerik().PanelBar()
                                .Name("catalog")      
                                .Items(item=>
                                {
                                    item.Add()
                                        .Text("my_groups")
                                        .ImageUrl("~/Content/Img/GridTab/groups.png")
                                        .ImageHtmlAttributes(new { alt = "My Groups Icon" })
                                        // using items - that expands fine
                                        //.Items( subItem=>{ subItem.Add().Text("Test").Action("test","test");})
                                        // using content() - that doesn't
                                        .Content(() =>
                                        {
                                            %>
                                            <ul class="t-group">
                                                <li class="t-item t-state-default">
                                                    <a class="t-link" href="/MyTest/Test">Test</a>
                                                </li>
                                            </ul>
                                            <%
                                        })
                                        .Expanded(true);    
                                }).Render();
  
                            });
                })
       .SelectedIndex(0)
       .Render(); %>
</asp:Content>

4 Answers, 1 is accepted

Sort by
0
Dmitry
Top achievements
Rank 1
answered on 14 Nov 2010, 05:43 PM

And one more thing i've noticed.

when i use content() method the inner html is located in the <div class="t-content"> tag. if i use items - the content is located right in to the <ul>. so i tried to write smth like that

.Content(() =>
{
    %>
    </div>
    <ul class="t-group">
        <li class="t-item t-state-default">
            <a class="t-link" href="/MyTest/Test">Test</a>
        </li>
    </ul>
    <div>
    <%
})
insted of

 

.Content(() => 
    %> 
    <ul class="t-group"
        <li class="t-item t-state-default"
            <a class="t-link" href="/MyTest/Test">Test</a
        </li
    </ul
    <% 
})
that began to work somehow fine.

so there is something about that div or it's class or how it is processed by the script.

hope it would be helpful for you.

thx!

0
Alex Gyoshev
Telerik team
answered on 17 Nov 2010, 12:54 PM
Hello Dmitry,

Indeed, this behavior is by design -- we strive to leave all user content in tact, and to suppress all of our code within it. If the hack that you found works for you, you may use it, yet it is not officially supported (i.e. if something goes wrong). That said, why not use the .Items method?

Greetings,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Dmitry
Top achievements
Rank 1
answered on 17 Nov 2010, 09:16 PM

Hi!!!Thx for the answer!!

but....

but...but...

"By design" it's not the good answer for me =(, becuase if you allow using such html you should process it correctly.

Items method is very good, but in Q2 the selection remained on the item, that was thr reason to explore some other ways.

translit:

Po moemy u vas tam mnogo russkih

Nu esli net, to i bog s nim.

Smisl moegp obrashenia v tom chto esli uj vi predostavlyaete vozmoznost renderit svoi html v kontrolah, to sdelaite eto universalnym!

To chto ya seicas opisal eto - bug, a ne "by design"

Esli eto by design, to opishite kakie konstrukcii forbidden dlya telerik

And the last one.

Why dont you particapate in platforma 2011 in russsia. our components are great and ifyou particapet and my boss will see you may be he will give me money to buy full version of your components

0
Dmitry
Top achievements
Rank 1
answered on 17 Nov 2010, 09:18 PM

For the justice i say!

In the last version the bug is fixed! Thx!

Tags
General Discussions
Asked by
Dmitry
Top achievements
Rank 1
Answers by
Dmitry
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or