Telerik Forums
Kendo UI for jQuery Forum
2 answers
242 views

Hello,

 

I have a tab stripe and the tab Content which is a grid bound to datatable gets loaded with Ajax call like this

      @(Html.Kendo().TabStrip()
.Name("myKendoTabs")
.Animation(animation =>
{
    animation.Enable(false);
})
.SelectedIndex(0)
    .Items(t =>
    {
        t.Add().Text("Objektliste").LoadContentFrom("GetObjectsforAdress", "AdressActivity", new { strAdressID = ViewBag.SelAdressID });
    })
        )

 

And the GetObjectsforAdress method in Controller Returns a partial view

return PartialView("DocumentList", ds.Tables[0]);

 

and the partialview is like this

            @(Html.Kendo().Grid(Model)
    .Name("Grid_ObjActivity")
                  .Scrollable()
     .HtmlAttributes(new { style = "height: 300px;" })
     .DataSource(dataSource1 => dataSource1
                    .Ajax()
                    .PageSize(100)
                    .Model(model1 =>
                    {
                        if (Model != null)
                        {
                            foreach (System.Data.DataColumn ocolumn in Model.Columns)
                            {
                                model.Field(ocolumn.ColumnName, ocolumn.DataType);
                            }
                        }
                    })
 .ServerOperation(false)
                     )
                      .Resizable(resize => resize.Columns(true))
    .Columns(columns =>
    {
        if (ViewBag.ObjListHeader != null)
        {
            for (int j = 0; j < ViewBag.ObjListHeader.GetLength(0); j++)
            {
              
                            columns.Bound(ViewBag.ObjListHeader[j, 0]).Title(ViewBag.ObjListHeader[j, 0]).Width(120);
                   
            }
        }
    })
    .Selectable(selectable => selectable
            .Mode(GridSelectionMode.Single))
.Filterable(filterable => filterable
                                  .Extra(false)
                                  .Operators(operators => operators
                                      .ForString(str => str.Clear()
                                          .StartsWith("Starts with")
                                          .IsEqualTo("Is equal to")
                                          .IsNotEqualTo("Is not equal to")
                                      ))
                                  )
                              .Groupable()
                              .Reorderable(r => r.Columns(true))
                    .Resizable(r => r.Columns(true))
                              )

 

The Problem is when the tab is selected then GetObjectsforAdress method is called twice. Loads once and again loads. Not sure why it is called twice.

Can you please suggest what am i doing wrong here.

 

Thanks

 

Anamika

Anamika
Top achievements
Rank 1
 answered on 19 Jun 2017
7 answers
210 views
1) Why do you think the cancel button would wipe all the entries?
http://screencast.com/t/MJ6AJU2Kf

2) Is there ANY way to do a drag\drop reorder with kendo?  You know how the left of the items would have draghandles and the user could re-order items as needed and the model (MVVM) would reflect the new order?

<div data-role="listview"
    data-template="list-template"
    data-edit-template="edit-template"
    data-bind="source: controls">
</div>

<script id="list-template" type="text/x-kendo-template">
    <div>
        # if(data.ControlType === "TextBox") { #
            <h3>#:Label#</h3>
            <input type="text" data-bind="value: PropertyName" class='k-textbox' disabled="disabled" />
        # } else if(data.ControlType === "DateTime"){ #
            <h3>#:Label#</h3>
            <input type="text" data-bind="value: PropertyName" data-role="datetimepicker" disabled="disabled" />
        # } else if(data.ControlType === "CheckBox"){ #
            <label>
                <span data-type="CheckBox">
                    <input type="checkbox" disabled="disabled">
                </span>
                #:Label#
            </label>
        # } #
     
        <a class="k-button k-button-icontext k-edit-button" href="\\#"><span class="k-icon k-edit"></span></a>
        <a class="k-button k-button-icontext k-delete-button" href="\\#"><span class="k-icon k-delete"></span></a>
    </div>
</script>
 
<script id="edit-template" type="text/x-kendo-template">
    <div>
        <input type="text" data-bind="value: Label" class='k-textbox' style="width: 100px" required="required"  />
        <br/>
        <input type="text" data-bind="value: PropertyName" class='k-textbox' required="required"  />
        <select data-bind="source: controlTypes, value: ControlType" data-role="dropdownlist"></select>
        <br/>
        <div class="edit-buttons">
            <a class="k-button k-button-icontext k-update-button" href="\\#"><span class="k-icon k-update"></span>Update</a>
            <a class="k-button k-button-icontext k-cancel-button" href="\\#"><span class="k-icon k-cancel"></span>Cancel</a>
        </div>
    </div>
</script>

Am I missing something?  Should be like the demo?


Steve
Konstantin Dikov
Telerik team
 answered on 19 Jun 2017
1 answer
154 views
Hello,

I'm trying to follow along in this guide here:

http://docs.telerik.com/aspnet-mvc/getting-started/asp-net-mvc-5

... going with the "Use CDN Services" section.

I did everything it says to do and I get an except when I run my application:

http://www.shahspace.com/acm/json viewer harness testing/Kendo/HttpCompileException.png

I'm getting this in my _loginLayout.cshtml file.

I've pinned the problem down to these references here, which are in the head of my _mainLayout.cshtml file:

    <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2017.1.118/styles/kendo.common-bootstrap.min.css" />
    <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2017.1.118/styles/kendo.bootstrap.min.css" />

    <script src="http://kendo.cdn.telerik.com/2017.1.118/js/kendo.all.min.js"></script>
    <script src="http://kendo.cdn.telerik.com/2017.1.118/js/kendo.aspnetmvc.min.js"></script>

If I comment this out, my application runs fine.

I got the latest Kendo version from here:

http://docs.telerik.com/kendo-ui/intro/installation/prerequisites

...which says that 2017.1.118 is the latest.

In our application, we already have JQuery and Bootstrap. I'm wondering if the inclusion of these references are clobbering them.
Konstantin Dikov
Telerik team
 answered on 19 Jun 2017
1 answer
164 views

How do I set the date-format of a pie chart with mvvm?

I would like a result like this(attached file)

 

Daniel
Telerik team
 answered on 19 Jun 2017
1 answer
159 views

I have a pie chart. This is the code:

 

<div data-role="chart"data-legend="{ position: 'bottom' }"data-series-defaults="{ type: 'column' }"data-category-axis="{
                        field: 'name',
                    }"data-value-axis="[
                        { name: 'name'},
                    ]"data-series-colors="['#DDDDDD','#FFFF00','#FF0000','#00CC00']"data-series="[
                                { field: 'doc1', name: 'doc', labels: {visible: true} },
                                { field: 'doc2', name: 'doc', labels: {visible: true} },
                                { field: 'doc3', name: 'doc', labels: {visible: true} },
                                { field: 'doc4', name: 'doc', labels: {visible: true} }
                             ]"data-bind="source: DocSource,
                            events: { seriesHover: onSeriesHover }"></div>

I wuold like set data with '%' using MVVM of kendo

Daniel
Telerik team
 answered on 19 Jun 2017
2 answers
894 views

I have an MVC grid where I have a Save event defined as follows:

.Events(events => events.Change("gridRowChange").Edit("onEdit").Save("onSave"))

In my JavaScript code I have an onSave(e) function defined that never gets called when a grid item is saved.

I should also point out that all grid rows in this page are saved manually via a JS function containing the following line.

    $("#grid").data("kendoGrid").saveRow();

I saw in another thread from several years ago that someone else was having the same issue doing what I'm doing but I never saw a resolution.

Georgi
Telerik team
 answered on 16 Jun 2017
1 answer
239 views

I am trying to get Font Awesome icons to display in my custom editor tool. The example I found here: http://docs.telerik.com/kendo-ui/controls/editors/editor/how-to/appearance/add-icon-custom-tool no longer works. We are using version 2016.3.1118 and although the example is broken in both that version and the latest release, they do display different behavior so please provide an update to the example for version 2016.3.1118. Thanks!

Dimitar
Telerik team
 answered on 16 Jun 2017
3 answers
209 views
We need to do some format change operation only for pasted data which is copied from other spreadsheet. That format change is not applicable for manually written data  We have tried to distinguish pasted data from manually written data in 'Change' event of spreadsheet but could not find any clue.
Veselin Tsvetanov
Telerik team
 answered on 16 Jun 2017
2 answers
538 views

I am trying to create a master/detail grid using this example Kendo Dojo. It seemed to work fine as both grids are receiving data. However, when I expand the detail grid the rows do not display. If you see the example below, TagID #1 has a record count of 1 detail row that should display but it doesnt'. It only shows like a white space, whereas TagID #22 which does not have any detail records shows a record count of 0 and a completely empty grid.

Here is my HTML:

<div kendo-grid="tagsGrid" options="tagsGridOptions">

    <div k-detail-template>

<kendo-tabstrip>

<ul>

<li class="k-state-active">Tagged Contractors</li></ul>

<div>

<div kendo-grid k-options="detailGridOptions(dataItem)"></div>

</div></kendo-tabstrip></div>

</div>

Here is my Angular Controller Code for the detail grid:

 

$scope.detailGridOptions = function (dataItem)

{return

{ dataSource:

{ type: 'aspnetmvc-ajax', transport:

{ read: "/Home/GetTaggedContractorsByMajor"},

serverPaging: true,

serverSorting: true,

serverFiltering: true,

pageSize: 5,

filter: { field: "TagID", operator: "eq", value: dataItem.TagID },

schema: { data: "Data", total: "Total"}},

scrollable: false,

sortable: true,

pageable: true,

columns: [{ field: "CompanyID", title: "CompanyID"},{ field: "vchCompanyName", title: "Company Name"}]};};

I didn't include the code for the master grid for brevity, but if anyone feels they need it in order to help, I will gladly add it.
Alex Hajigeorgieva
Telerik team
 answered on 16 Jun 2017
1 answer
583 views

We have a grid configured with the "all" page size in the options: 

this.gridOptions.pageable = <kendo.ui.GridPageable>{
                input: true,
                numeric: false,
                pageSizes: ["all", 5, 10, 20, 50],
                refresh: true
            };

 

When we programmatically refresh the grids datasource (below), and that refresh pulls in an additional item to display in the grid, the pager in the grid is no longer what we'd expect. 

this.manageGridDataSource.read();

 

If the grid had 9 items before, the pager now shows 9, and the new item is now on page two. I understand that the "all" selection just sets the pageSize to the total number of items in the datasource, but what we want to happen is that after the refresh, the "all" setting is preserved and the additional grid item displays on the first page, not generate a second page of data. 

Do you know how this can be achieved? 

Stefan
Telerik team
 answered on 16 Jun 2017
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
Styling
ColorPicker
Pager
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?