Telerik Forums
UI for ASP.NET MVC Forum
2 answers
253 views
I have a panelbar in which the content is loaded via ajax.

I would like to reload the content based on the change event in a dropdown list.  However, it doesn't appear that I can do this.

I tried the reload() method on the panelbar object but it didn't do anything so I figured there was some caching involved.

Can I trigger a reload to occur?

Below is my client-side code and the panelbar.

thanks
var panelbar = $("#HomePanelBar").data("kendoPanelBar");
panelbar.reload();
 
 @(Html.Kendo().PanelBar()
        .Name("HomePanelBar")
        .HtmlAttributes(new { style = "width:400px;" })
        .ExpandMode(PanelBarExpandMode.Single)
        .Items(panelBar =>
        {
            panelBar.Add()
                .Text("Notification")
                .HtmlAttributes(new { id = "item1" })
                .Expanded(true)
                .LoadContentFrom("_Announcement", "Help");
        })
    )
 


William Dunn
Top achievements
Rank 1
 answered on 08 Jul 2013
3 answers
287 views
Hej

Im trying to use the Kendo Grid for a minor project, where i want to show the column summary in the groupheader. But I cant get it to Work :-(. When i use the Groupfooter, then it works fine.

Anyone got any suggestions?

************************************************************************************
@(Html.Kendo().Grid((IEnumerable<FTEReport>)ViewBag.Test) 
     .Name("grid")
     .Columns(columns =>
{
 columns.Bound(FTEReport => FTEReport.Jan)
.ClientGroupHeaderTemplate("#=sum#");

columns.Bound(FTEReport => FTEReport.Feb)
.ClientGroupFooterTemplate("#=sum#"); 
}
 .DataSource(ds => ds.Ajax()
.Aggregates(aggregates =>
{
aggregates.Add(p => p.Jan).Sum();
aggregates.Add(p => p.Feb).Sum();
 })
.Group(g =>
{
g.Add(c => c.Allocated);
g.Add(c => c.Project);
g.Add(c => c.Department);
})
.Read(read => read.Action("Aggregates_Read", "grid"))
 )
)

Regards
Lennart
Vladimir Iliev
Telerik team
 answered on 08 Jul 2013
2 answers
180 views
I use a splitter with a left and a right pane within a window widget. If I create the window with “Visible(true)” everything works as it should.
But since the window is supposed to be displayed, when the user clicks on a button, I have to use “Visible(false)” and make it visible after the click occurred.
 In this case the given pane size of the left pane seems to be ignored and the right pane is not displayed at all(see attached picture).

After manual resize of the splitter, it seems to work. But when I close the window and reopen it via Javascript, the size parameter is still ignored. Instead the
manual chosen size is used. It makes no difference if I use Ajax Loading or direct rendering. My Code:

Window:
@( Html.Kendo().Window()
       .Name("popupSplitter")
       .Title("Popup Splitter")
       .Draggable(true)
       .Modal(true)
       .Content(
           @<text>
<div>
    @RenderSplitter()
</div>
    </text>
)
        .Width(600)
        .Height(450)
        .Visible(false)
)
Splitter:
@helper RenderSplitter()
{
   @Html.Kendo().Splitter()
   .Name("MySplitter")
   .Orientation(SplitterOrientation.Horizontal)
   .HtmlAttributes(new { style = "width: 100%; height: 400px; " })
   .Panes(hPanes =>
       {
            hPanes.Add()
                  .Size("200px")
                  .MinSize("100px")
                  .Content(
                      @<text>
                           @RenderTreeView()
  </text>
                  )
                  .HtmlAttributes(new { id = "left_pane" });
 
            hPanes.Add()
                  .Scrollable(true)
    .HtmlAttributes(new { id = "right_pane" });
                  .Content(
                      @<text><p>test</p></text>
                );
        })
}
Button:
<button class="k-button" id="btnAdd" onclick="addSomething()"><span class="k-icon k-add"></span></button>
Javascript:
function addSomething() {
        var window = $("#popupSplitter ").data("kendoWindow");
        window.center();
        window.open();
}

Am I missing something here?
KRichter
Top achievements
Rank 1
 answered on 08 Jul 2013
6 answers
153 views
Dear KendoUI Team!
In one of my Views I alwas get a javascript error when I leave the focus of the Dropdownlist.

The error occurs in parseJSON in this line:
{return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)}

The Model looks like this:
[Required]
        [LocalizedDisplayName("Language")]
        public int PreferredLanguageId { get; set; }

And the cshtml is here:

div class="type-text">                            
                            @(Html.Kendo().DropDownListFor(m => m.PreferredLanguageId)
                            .Name("PreferredLanguageId")
                            .SelectedIndex(Model.PreferredLanguageId)
                            .BindTo(LeoHelper.GetLanguages())
                            .DataTextField("Text")
                            .DataValueField("Value")
                            )
                        </div>

Although the javascript Exception is thrown, the value is correctly saved.

brgds
Malcolm Howlett
Christopher
Top achievements
Rank 1
 answered on 08 Jul 2013
6 answers
300 views
Hello,

I have an editable grid and added a filter dropdown on the toolbar

       .ToolBar(c=>
        {
            c.Template(Html.Kendo().DropDownList()
               .Name("tb_factory_list")
               .DataTextField("factoryname")
               .DataValueField("factoryid")
               .Events(e => e.Change("onChange"))
               .SelectedIndex(0)
               .DataSource(source =>
                   {
                       source.Read(read =>
                           {
                               read.Action("GetFactories", "Home");
                           });
                   })
               .HtmlAttributes(new { style = "width:300px;float:right" })
               .ToHtmlString());
        })


problems :

1) How do I get the 'add new item' button back  ?
.ToolBar(tb => { tb.Create();  })

2) the width of the dropdown is whatever the width of the initial displayed item.
I had to manually force the dropdown to be wider to accomodate the widest item in the dropdown (see above 300px)
Is that normal ? can the dropdown resize to the widest item in the dropdown ?

3) when the page is opened, the dropdown displays the first item, but the onchange event is not called.
So initially, the results are not filtered by whatever the dropdown shows.
after I select another item in the dropdown, then the onchange is fired and filtering happens.
How can I filter correctly when the page is first loaded ?

Thanks
Marcel



Dongfen
Top achievements
Rank 1
 answered on 05 Jul 2013
1 answer
133 views

Questions in the image in attachemnt since I get a "invalid post content" message.


Iliana Dyankova
Telerik team
 answered on 05 Jul 2013
1 answer
216 views
Hello,

I am using Kendo 2013.1.514.340 with asp.net mvc.

I am sending the Json to the grid that is generated from the following data structure:
I have two entities, Parent and Child.  A Parent can have n Children.  In this case a single Parent has two Children.  

I use NewtonSoft to serialize the Json with the following settings:

SerializerSettings = new JsonSerializerSettings
{
    ContractResolver = new DefaultContractResolver
    {
        IgnoreSerializableAttribute = true,
        IgnoreSerializableInterface = true
    },
    PreserveReferencesHandling = PreserveReferencesHandling.Objects,
    ReferenceLoopHandling = ReferenceLoopHandling.Ignore
};
When I have the case of a single parent with a single child all works fine.

The following Json is generated for a single parent that has two children:

{
  "$id": "1",
  "Data": [
    {
      "$id": "2",
      "Aktiv": false,
      "AktualisiertAm": "2013-05-16T11:05:20.273",
      "AktualisiertVon": "abascore",
      "Bemerkung": "",
      "Bezeichnung": "Child",
      "ErzeugtAm": "2013-05-16T11:05:20.273",
      "ErzeugtVon": "abascore",
      "Id": "615cba40-7c17-4a98-9371-443310947b81",
      "ParentId": "c6113c45-bd23-44d3-bfa2-470f647adc75",
      "Nr": 1,
      "Rowverion": "AAAAAAAAorQ=",
      "Sprache": "de-de",
      "Status": 0,
      "Parent": {
        "$id": "3",
        "Branche": "",
        "MaAnzahl": 2,
        "PoG": 1,
        "UnternehmenGroesse": 0,
        "Child": [
          {
            "$ref": "2"
          },
          {
            "$id": "4",
            "Aktiv": false,
            "AktualisiertAm": "2013-07-03T18:31:00.953",
            "AktualisiertVon": "abascore",
            "Bemerkung": "",
            "Bezeichnung": "Child2",
            "ErzeugtAm": "2013-07-03T18:31:00.953",
            "ErzeugtVon": "abascore",
            "Id": "6662074d-2682-4c2d-a4fc-c01ae9eb7cfc",
            "ParentId": "c6113c45-bd23-44d3-bfa2-470f647adc75",
            "Nr": 2,
            "Rowverion": "AAAAAAACOlE=",
            "Sprache": "de-de",
            "Status": 0,
            "Parent": {
              "$ref": "3"
            }
          }
        ],
        "AktualisiertAm": "2013-05-16T11:05:05.333",
        "AktualisiertVon": "abascore",
        "Bemerkung": "",
        "Bezeichnung": "Parent",
        "Descriminator": "MAND",
        "Email": "Parent@masdnad.asda",
        "ErzeugtAm": "2013-05-16T11:05:05.333",
        "ErzeugtVon": "abascore",
        "Id": "c6113c45-bd23-44d3-bfa2-470f647adc75",
        "Logo": "",
        "Mobil": "",
        "Name0": "Parent",
        "Name1": "",
        "Nr": 1,
        "Ort": "München",
        "Plz": "12345",
        "Postfach": "",
        "Rowverion": "AAAAAAAAorI=",
        "SatzQuelle": null,
        "Staat": "Parentland",
        "Strasse": "Parentenstrasse",
        "Telefon": "",
        "Website": "",
        "Ansprechpartners": []
      }
    },
    {
      "$ref": "4"
    }
  ],
  "Total": 2,
  "AggregateResults": null,
  "Errors": null
}


This leads to the following error:
Uncaught TypeError: Cannot read property 'Bezeichnung' of undefined
(anonymous function)
T.extend._rowsHtml kendo.all.min.js:18
T.extend.refresh kendo.all.min.js:18
b.isFunction.i jquery.min.js:3
i.extend.trigger kendo.all.min.js:9
nt.extend._process kendo.all.min.js:11
nt.extend.success kendo.all.min.js:11
b.isFunction.i jquery.min.js:3
n.success kendo.all.min.js:11
c jquery.min.js:3
p.fireWith jquery.min.js:3
k jquery.min.js:5
r

I would really appreciate any about this issue!

Best regards

Vladimir Iliev
Telerik team
 answered on 05 Jul 2013
3 answers
250 views
Hello!
I use serializeArray  for form.
But this function doesn't return object, which have disabled fields
I use:
@(Html.Kendo().IntegerTextBoxFor(m => m)
      .Enable(false)
      .Spinners(false).....
But if I use:
@(Html.Kendo().IntegerTextBoxFor(m => m)...
All good.
Question: Need I get this(disaled) field by $(..[name="...]) or that I can do?
Daniel
Telerik team
 answered on 05 Jul 2013
1 answer
100 views
Hi

I have been look at Kendo a few days and now trying to move into to a Production alike environment (Testing).

When i start moving into the server (using Web Deploy), and browse to the page with the Kendo control. It dont render right.ex. for a grid It only show the table and text, but all the functionality is gone. I also try with a DatePicker here it only show a whitebox with text?  Looks like im missing some scripts files???

Lennart
Dimo
Telerik team
 answered on 05 Jul 2013
1 answer
137 views
Consider the following cshtml file.  I have changed the style for the tab to hide the tabstrip item headers and added previous/next buttons to the page to simulate a wizard.  If I don't turn off animation for the tabstrip and the user double clicks on the previous or next button the contents of two tabs will be shown stacked on top of one another.  Is there anything I can do about this or is this a bug?

@{
    ViewBag.Title = "About";
}
<hgroup class="title">
    <h1>@ViewBag.Title.</h1>
    <h2>@ViewBag.Message</h2>
</hgroup>
<button id="Previous" class="toggleTab k-button" onclick="moveToTab(-1);return true;">
    Previous</button>
<button id="Next" class="toggleTab k-button" onclick="moveToTab(1);return true;">
    Next</button>
@(Html.Kendo().TabStrip()
          .Name("tabstrip")
          .Animation( false)
          .Items(tabstrip =>
          {
              tabstrip.Add().Text("Paris")
                  .Selected(true)
                  .Content(@<text>
                                Paris
                            </text>);

              tabstrip.Add().Text("New York")
                  .Content(@<text>
    New York
</text>);

              tabstrip.Add().Text("Moscow")
                  .Content(@<text>
Moscow
</text>);

              tabstrip.Add().Text("Sydney")
                  .Content(@<text>
Sydney
</text>);
    tabstrip.Add().Text("Fort Worth")
                  .Content(@<text>
Fort Worth
</text>);
          })
    )
<script>

    var currentIndex = 0;
    var maxIndex;
    var tabStrip;
    
    function moveToTab(increment) {

        if (increment > 0) {
            if (currentIndex < maxIndex) {
                currentIndex++;
                tabStrip.select(currentIndex);
            }
        } else {
            if (currentIndex > 0) {
                currentIndex--;
                tabStrip.select(currentIndex);
            }
        }

    }

    $(document).ready(function () {

        tabStrip = $("#tabstrip").data("kendoTabStrip");
        maxIndex = tabStrip.items().length - 1;
    });
</script>

<style scoped>
    #tabstrip ul.k-tabstrip-items {
    display: none;
}
</style>
Vladimir Iliev
Telerik team
 answered on 04 Jul 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Security
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?