Telerik Forums
Kendo UI for jQuery Forum
3 answers
3.9K+ views
Using MY WCF Service I am exposing JSON data.

[OperationContract]
 [WebGet(ResponseFormat=WebMessageFormat.Json)]
 List<ProductDetails> GetProductDetails();

The sample of JSON data returned is :

{"d":[{"_type":"ProductDetails:#NWProducts","Discount":0,"OrderId":10248,"ProductId":11,"UnitPrice":14.0000,"quanity":12},{"_type":"ProductDetails:#NWProducts","Discount":0,"OrderId":10248,"ProductId":42,"UnitPrice":9.8000,"quanity":10},{"_type":"ProductDetails:#NWProducts","Discount":0,"OrderId":10248,"ProductId":72,"UnitPrice":34.8000,"quanity":5},{"_type":"ProductDetails:#NWProducts","Discount":0,"OrderId":10249,"ProductId":14,"UnitPrice":18.6000,"quanity":9},{"__type":"ProductDetails:#NWProducts","Discount":0,"OrderId":10249,"ProductId":51,"UnitPrice":42.4000,"quanity":40}


Trying to bind that to Kendo Grid using :

 
<script type="text/javascript">
                $(document).ready(function () {
                    $("#grid").kendoGrid({
                        dataSource: {
                            type: "json",
                            transport: {
                                 read: function (options) {
                                $.ajax({
                                    url: "http://localhost/KendoServices/Web/GetProductDetails",
                                    dataType: "json",
                                    success: function (result) {
                                        options.success(result);
                                    }
                                });
                            },
                            batch: true,
                            schema: {
                       type: 'json',
                       model: {
                           id: "OrderId",
                           fields: {
                               OrderId: { type: "string" },
                               ProductId: { type: "string" },
                               UnitPrice: { type: "string" },
                               quanity: { type: "string" },
                               Discount: { type: "string" }
                              }
                            }
                         },
                            pageSize: 10
                        },
                        height: 430,
                        filterable: true,
                        groupable: true,
                        sortable: true,
                        pageable: true,
                        columns: [{
                            field: "OrderId",
                            title: "OrderId",
                            width: 140
                        }, {
                            field: "ProductId",
                            title: "ProductId",
                            width: 190
                        }, {
                            field: "UnitPrice",
                            title: "UnitPrice"
                        }, {
                            field: "quanity",
                            width: 110
                        },{
                            field: "Discount",
                            width: 110
                        }]
                    });
                });
            </script>


But not able to bind the data to Grid. I think it's not even accessing the service.

Where am I doing wrong?
Nikolay Rusev
Telerik team
 answered on 26 Feb 2014
3 answers
78 views
Hi,

Please see attached image. When I try to load the grid, it throws "Unable to get property min of null reference.". Please let us know what is the fix for this, as this is not always thrown. But, we are not able to get the scenario for this error.

Thanks,
Shobana
Alexander Popov
Telerik team
 answered on 26 Feb 2014
1 answer
165 views
Hi Guys
I am currently validating the scheduler widget and it looks to me, like the datasource always requests the whole
calendar. We are actually storing millions of terms on the server side, so there must be a way to, lets say, just showing the terms of a
day, week, month or the like. I couldn't find any query parameter or post data when the datasource actually calls the read url.
Is there any way to constraint the time range for a read request of terms?

Best regards
Samuel
Rosen
Telerik team
 answered on 26 Feb 2014
1 answer
130 views
Hi - I have a grid that I want to have batch edit on.  One field is to select schools that a user has access to see, and I want to do some kind of multi-select for that.  I wanted to do a drop-down, but can't do multi-select of course.  So, I'm looking at doing a multi-select, but would like it to be in a pop-up window to make it easier for the user to see.  I think I can give them more room to see their choices as compared to a grid column.  Does that makes sense as an approach, and can it be done?

Thanks

Lisa
Vladimir Iliev
Telerik team
 answered on 26 Feb 2014
4 answers
149 views
I'm trying to add the pager items in my grid to the tab order (to satisfy a11y issues logged by a11y group).  Since I need to have the pager items added to the DOM first, I am hooking this into the dataBound event (b/c I couldn't find another event that was a better choice).  The problem is that the pager items' tab order isn't being updated.  Any ideas why?

dataBound: function (e) {
  $('#' + e.sender.element[0].id + '>div[data-role=pager]>a.k-link').attr('tabindex', '0');
},

Thanks,
--Ed
Dimo
Telerik team
 answered on 26 Feb 2014
1 answer
143 views
I'm not sure if it's a ScrollView issue, please move the thread if this is the wrong sub forum.

When rotating a device after scrolling down a page a bit, Kendo always resets the view to 0,0. We are currently building an App where users are going to read larger pages with some scrollable content, and beta testers have already reported this as being very annoying.

Is there a way to prevent this form happening?

Thanks in advance,
Roman
Kiril Nikolov
Telerik team
 answered on 26 Feb 2014
1 answer
130 views
@(Html.Kendo().Scheduler<Services.AspNet.Mvc.Areas.Services_CreateServiceOrder.ProjectionsScheduler>()
.Name("scheduler")
.Date(DateTime.Today)
.StartTime(new DateTime(2013, 6, 13, 7, 00, 00))
.EndTime(new DateTime(2013, 6, 13, 19, 00, 00))
.Height(350)
.AllDaySlot(false)
.Views(views =>views.DayView();})
.Group(group => group.Resources("Technicals"))
.Timezone("Etc/UTC")
.Resources(resource =>   {
resource.Add(m => m.TechnicalId)
.Title("Technical")
.Name("Technicals")
.DataTextField("Text")
.DataValueField("Value")
.BindTo(ViewBag.Technicals);})
.BindTo(Model)
.DataSource(d => d.ServerOperation(true)
.Model(m =>{
m.Id(f => f.TechnicalId);
m.Field(f => f.Description).DefaultValue("No title");
m.Field(f => f.IsAllDay).DefaultValue(false);
})
.Create("Grouping_Horizontal_Create", "CServiceOrder")
.Destroy("Grouping_Horizontal_Destroy", "CServiceOrder")
.Update("Grouping_Horizontal_Update", "CServiceOrder")
)
)

I can't open a window to create or edit the appointment when I click in Scheduler. I also need to change the appointment's title because now is showing the hours.  

Here is my Scheduler code:

@(Html.Kendo().Scheduler<Services.AspNet.Mvc.Areas.Services_CreateServiceOrder.ProjectionsScheduler>()
.Name("scheduler")
.Date(DateTime.Today)
.StartTime(new DateTime(2013, 6, 13, 7, 00, 00))
.EndTime(new DateTime(2013, 6, 13, 19, 00, 00))
.Height(350)
.AllDaySlot(false)
.Views(views =>
{
views.DayView();
})
.Group(group => group.Resources("Technicals"))
.Timezone("Etc/UTC")
.Resources(resource =>
{
resource.Add(m => m.TechnicalId)
.Title("Technical")
.Name("Technicals")
.DataTextField("Text")
.DataValueField("Value")
.BindTo(ViewBag.Technicals);
})
.BindTo(Model)
.DataSource(d => d.ServerOperation(true)
.Model(m =>
{
m.Id(f => f.TechnicalId);
m.Field(f => f.Description).DefaultValue("No title");
m.Field(f => f.IsAllDay).DefaultValue(false);
})
.Create("Grouping_Horizontal_Create", "CServiceOrder")
.Destroy("Grouping_Horizontal_Destroy", "CServiceOrder")
.Update("Grouping_Horizontal_Update", "CServiceOrder")
)
)
Rosen
Telerik team
 answered on 26 Feb 2014
1 answer
173 views
I thought I had this but I think I'm missing something.

I think I read somewhere FooterTemplate doesn't work.  Is this correct?

I can count using ClientFooterTemplate, but when I sum the value appears to be concatenating.

Any assistance would be helpful.  Thanks in advance.

Here's what I have:

<div>
    @(Html.Kendo.Grid(Of Venable.KMVC.ClientPortfolio.ADRServiceReference.Activity)() _
            .Name("clientActivityYear") _
            .Events(Sub(e)
                            e.DataBound("onDataBound").Change("onChange")
                    End Sub) _
            .Columns(Sub(c)
                             c.Bound(Function(p) p.Year).FooterTemplate("LTD")
                             c.Bound(Function(p) p.WorkedActivity).Title("Worked").HtmlAttributes(New With {.style = "text-align: right"}).ClientFooterTemplate("#=sum#")
                             c.Bound(Function(p) p.BilledActivity).Title("Billed").HtmlAttributes(New With {.style = "text-align: right"})
                             c.Bound(Function(p) p.CollectedActivity).Title("Collected").HtmlAttributes(New With {.style = "text-align: right"})
                     End Sub) _
        .Selectable(Function(selectable) selectable.Mode(GridSelectionMode.Single)) _
        .Scrollable() _
        .DataSource(Sub(d)
                            d.Ajax().ServerOperation(False).Aggregates(Sub(aggregates)
                                                                               aggregates.Add(Function(p) p.WorkedActivity).Sum()
                                                                               aggregates.Add(Function(p) p.BilledActivity).Sum()
                                                                               aggregates.Add(Function(p) p.CollectedActivity).Sum()
                                                                       End Sub) _
                            .Read(Function(read) read.Action("ActivityRead", "Home").Data("addData"))
                    End Sub)
     )
</div>
Alexander Popov
Telerik team
 answered on 26 Feb 2014
2 answers
451 views
H I have simple grid with checkboxes column. What I want to achieve is to select checkbox when one of two states will happen
1. I click on the row
2. I click on the checkbox

In kendo there is one event 'change'  which is triggered by the two states above.

My logic is following
When I click the row  then in change event i change property of the checkbox to select it the problem is that the same happen if I click checkbox in that row and then I can distinguish what is the source of triggering and again I am changing state of the checkbox.

Unfortunately this change event is triggered before checkbox selection put break in change event and click checkbox you will see that checkbox is not selected yet but even is triggeredand because I can distinguish the source I am trying to change state of the checkbox again and then there is conflic with DOM because after that occurs checkbox it's own event and is trying to manipulate its state again.

I would attache sample but it takes with all libraries 15 mega bytes which is much more then allowed 2 mega.
But I am including my view with all javascript and controller with repository class

Nikolay Rusev
Telerik team
 answered on 26 Feb 2014
3 answers
384 views
Hi there,

I have a kendo grid with a custom, unnamed command like this:

{ command: { text: "Download PDF", click: downloadPdf }, title: " ", width: "115px" }

How do I add an icon to the button? I tried setting the imageClass, like this:

{ command: { text: "Download PDF", click: downloadPdf }, title: " ", width: "115px", imageClass: "k-icon k-i-pencil" }

but the image never shows up. Things seem to work somewhat when I use one of the known commands like Edit or Destroy; I get the default icon, but not the one assigned by the k-i class. Any ideas?

Thanks in advance,

Imar
Imar Spaanjaars
Top achievements
Rank 1
 answered on 25 Feb 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
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
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
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?