Telerik Forums
Kendo UI for jQuery Forum
1 answer
583 views
I have a kendo grid that is loaded in a Kendo window. There is a date field in the grid that displays the date as /Date(.......)/
Also looked at the following thread http://www.telerik.com/forums/grid-client-template-and-date-formats, but the solutions provided there didn't work.

e.g. If I used this format:
columns.Bound(s => s.DateOpened).Template(@<Text></Text>).ClientTemplate("#=kendo.toString(DateOpened,'MM/dd/yyyy')#");

I end up getting a Invalid template error.

Changing it to:
columns.Bound(s => s.DateOpened).Template(@<Text></Text>).ClientTemplate("\\#=kendo.toString(DateOpened,'MM/dd/yyyy'\\)#");

displayed the date as /Date(1406727900000)/

Here is my grid sample:

<script type="text/x-kendo-template" id="SeverityDetailsTemplate">
    @(Html.Kendo().Grid<TestViewModel>()
    .Name("TestGrid")
    .Columns(columns =>
    {
        columns.Bound(s => s.CategoryId).Visible(false);
        columns.Bound(s => s.Name)
        columns.Bound(s => s.District)
        columns.Bound(s => s.CategoryName)
        columns.Bound(s => s.DateOpened).Template(@<Text></Text>).ClientTemplate("\\#=kendo.toString(DateOpened,'MM/dd/yyyy')\\#");
        columns.Bound(s => s.DateClosed);
        columns.Bound(s => s.Description);
    })
            .DataSource(ds => ds
                .Ajax()
                .PageSize(15)
                .Read(read => read.Action("GetTestGridDetails", "Home", new { categoryId = "#=CategoryId#" }))
                .Events(events => events.Error("grid_errorHandler"))
            )
            .Scrollable(s => s.Enabled(false))
            .Pageable(page => page.Refresh(false).PageSizes(new[] { 5, 10, 15, 20 }))
            .Resizable(r => r.Columns(true))
            .Sortable()
            .ToClientTemplate()
         )
</script>

The DateOpened field is of DateTime data type.

Petur Subev
Telerik team
 answered on 10 Oct 2014
10 answers
1.3K+ views
php with kendo grip, easy demo of create destory update and read, but create and update have the same js problem.

It return status : 200,so it works. And it has already persisted the database record, but js error:Uncaught SyntaxError: Unexpected number , so the popup update window can't close.

BTW, I didn't return in the background logic php. I have try return json ,but still same problem.

 source code:

<div id="user_grid"></div>
<script>
$(document).ready(function() {
getUserGrid("doAdminAction.php?act=");
});

function getUserGrid(crudServiceBaseUrl) {
var dataSource = new kendo.data.DataSource({
transport : {
read : {
url : crudServiceBaseUrl + "getAllUsers",
dataType : "json"
}, 
update : {
url : crudServiceBaseUrl + "updateUser",
contentType : "application/json",
type : "post"
},
create : {
url : crudServiceBaseUrl + "insertUser",
contentType : "application/json",
type : "post"
},
destroy : {
url : crudServiceBaseUrl + "delUser",
contentType : "application/json",
type : "post"
}, 
parameterMap : function(options, operation) {
if (operation !== "read" && options.models) {
return kendo.stringify(options.models);
}

},
batch : true,
pageSize : 50,
schema : {
model : {
id : "id",
fields : {
id : {
editable : false,
type : "number",
nullable : false
},
GUID : {
editable : false,
},
username : {
editable : true,
validation : {
required : true
}
}
}
}
}
});

$("#user_grid").kendoGrid({
dataSource : dataSource,
navigatable : true,
pageable : {
refresh : true,
pageSizes : true,
buttonCount : 2
}, 
sortable : true,
filterable : true,
groupable : true,
columnMenu : true,
editable : "popup",
resizable : true,
height : 720,
toolbar : [ {
name : "create",
text : "添加新用户"
} ],
columns : [ {
field : "id",
type : "number",
hidden : true,
},{
field : "username",
title : "用户名",
width : 50
},{
command : [ {
name : "edit",
text : "编辑"
}, {
name : "destroy",
text : "删除"
} ],
title : "操作栏",
width : 100
} ]
});
};
</script>
    </div>
</div>







Vladimir Iliev
Telerik team
 answered on 10 Oct 2014
1 answer
361 views
For some reason context menu goes outside screen boundary (see attached image) and this forces scrollbars to appear. If the target is at the bottom of the screen, then the context menu covers the target element itself.

This problem only occurs when the page has vertical scrollbar.

Initialization script:
jQuery(function(){
   jQuery("#SettingsContextMenu").kendoContextMenu({"openOnClick":true,"alignToAnchor":true,"target":"#GridSettings","showOn":"click"});});<br>
Kiril Nikolov
Telerik team
 answered on 10 Oct 2014
6 answers
537 views
I've been able to replicate this problem in angular (which we're implementing on the project I'm working on) on your dojo. Just for fun I was able to replicate it in regular jQuery as well. Hoping you might be able to pinpoint if I'm doing something wrong, or this may be an actual bug.

The DOJOs:
Angular: http://dojo.telerik.com/@yazdog8/eyAji/3
jQuery: http://dojo.telerik.com/@yazdog8/oxiCu

Steps to reproduce:
1. Run/load the grid
2. Go to the header column menu > columns
3. Deselect "Owner", "Tags" and "Size"
4. In the pagination controls > select the next page OR change the items per page from 25 to 50

What I'm seeing is that the hidden content is being shown in the table body. The table header is hiding the columns that are marked as hidden. 
Dimo
Telerik team
 answered on 10 Oct 2014
1 answer
154 views
I am creating a bubble chart by using MVC and would like to bind this chart from local data as the example in the link http://demos.telerik.com/aspnet-mvc/bubble-charts/local-data-binding.

The model I use is slightly different from the example.  I have a view model object,BubbleChartModel,contains a IEnumberable<MVCSample.Data.PGDataBySupplier> property called "DataPoints".
When I tried to bind the bubbles to this IEnumberable<MVCSample.Data.PGDataBySupplier> property, I received the error of

The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[MVCSample.Data.PGDataBySupplier]', but this dictionary requires a model item of type 'MVCSample.Models.BubbleChartModel'.

I am wondering if my approach is supported by Telerik. If not, is there any workaround?


Following is my code:

@model MVCSample.Models.BubbleChartModel
<div class="chart-wrapper">
@(Html.Kendo().Chart(Model.DataPoints)
.Name("chart")
.Series(series =>
{
series.Bubble(
model => model.PercentSavingsLow,
model => model.PotentialSavingsAvg,
model => model.TotalSpend,
model => model.ProviderShortName,
model => model.MemberStatECOLOR,
model => model.DisplayLegend,
model => model.ProviderShortName


); 
                     }
)
)


)
Hristo Germanov
Telerik team
 answered on 10 Oct 2014
3 answers
396 views
i need to add multiple resources to scheduler and second resource data lode according to the first resource list change.
i added two resources  with edit template. any workaround u have.
Vladimir Iliev
Telerik team
 answered on 10 Oct 2014
2 answers
342 views
I am trying to implement a screen with Three sortables (left pane, right pane, remove pane). When the user drags an item to the remove sortable I want to remove it from that sortable. (they are deleting it basically)

I have tried e.item.remove in the change event handler, but that just makes the dragged element show on the screen as well as the new item in the sortable. 

I have tried to prevent the drop to the new sortable using e.item.PreventDefault and also e.draggableObject.item.preventDefault and then just remove it from the original sortable, but I can't seem to prevent the change.

Any suggestions on how to do this?
Bob
Top achievements
Rank 1
 answered on 09 Oct 2014
5 answers
718 views
Hi Community, 

I need your help! :)

I've got a Kendo UI Grid with the following model:

Angelos.Namespace.GridModel = function () {
    return {
        Identifier: { editable: false, type: "string" },
        Date: { editable: false, type: "date" },
        Description: { editable: false, type: "string" },
        Priority: { editable: false, type:"number" },
        Regarding: { editable: false },
        Owner: { editable: false },
        Practice: { editable: false, type: "string" }
    };
}

So basically it is easy to add the menu filters for these fields... 
But since I am receiving objects for some of these fields, it makes the whole thing a little bit trickier... 

"Regarding" [Object]: Regarding.Name / Regarding.Value
"Owner" [Object]: Owner.Name / Owner.Value
"Priority" [Object]: Priority.Value

So for the fields "Regarding" and "Owner" I would do following:

var model = [{
            field: "Regarding",
            width: 80,
            filterable: true,
            title: "Regarding",
            template: '#=RegardingUrl#',
            filterable: {
                extra: false,
                field: 'Regarding.Name'
            }
        }, {
            field: "Owner",
            width: 80,
            filterable: true,
            title: "Physician - PCP",
            template: '#=OwnerUrl#',
            filterable: {
                extra: false,
                field: 'Owner.Name'
            }
        }];

This works. Because the comparison will be simple as  string.toLowerCase() == 'Name'

But now I want to do kinda the same for the "Priority" field, choosing its value by a dropdownlist...

var prio = {
            field: "Priority",
            width: 50,
            title: "Priority",
            template: '#= PriorityCodeName #',
            filterable: {
                extra: false,
                field: "Priority.Value",
                ui: function(element)
                {
                    element.kendoDropDownList({
                        dataSource: new kendo.data.DataSource(
                            { data: Tribridge.AlertsView.PriorityLabels }),
                        dataTextField: "text",
                        dataValueField: "value"
                    });
                }
            }
        };

Unfortunately this won't work because the comparison will be e.g.  1.toLowerCase() == '2' [Error]

I tried setting the type of "Priority" (in the model) to number and also to string, but it wont work... 

Any help... Please ... 


Thank you guys!

- Angelo
aortega
Top achievements
Rank 2
 answered on 09 Oct 2014
4 answers
190 views
If retry of failed upload successful, the upload still has error styling applied.  How do we "refresh" the list item with appropriate styling?  See screenshot attached.

Relevant code:

<input name="files" id="files" type="file" />

$("#files").kendoUpload({
    async: {
        saveUrl: "/Referral/UploadAttachment",
        removeUrl: "/Referral/DeleteAttachment",
        autoUpload: true
    },
    error: onError,
    upload: onUpload,
    remove: onRemove
});


Dimiter Madjarov
Telerik team
 answered on 09 Oct 2014
8 answers
319 views
I have quite simple dropdown in a hybrid app, but when selecting id does not select. when trying for the second time you can see that 2 options are selected but choice has not changed in collapsed view.
Thanks

<div id="near-km2"></div>
<script>
    function load() {
 
 
        var kmData = [{ text: "5km", value: "5" },
    { text: "10km", value: "10" },
    { text: "25km", value: "25" },
    { text: "50km", value: "50" }];
 
        $("#near-km2").kendoDropDownList({
            dataTextField: "text",
            dataValueField: "value",
            dataSource: kmData,
            index: 1
        });
    }
</script>
Alan Mosley
Top achievements
Rank 1
 answered on 09 Oct 2014
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
Application
Map
Drag and Drop
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
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
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
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?