Telerik Forums
Kendo UI for jQuery Forum
1 answer
96 views
Is it possible to disable mouse field events and dragging on the stock chart?
T. Tsonev
Telerik team
 answered on 17 Jun 2014
3 answers
365 views
I am trying to use the Notification control. However, when attempting to use it, the following compiler error is thrown: 

 CS1061: 'Kendo.Mvc.UI.Fluent.WidgetFactory<dynamic>' does not contain a definition for 'Notification' and no extension method 'Notification' accepting a first argument of type 'Kendo.Mvc.UI.Fluent.WidgetFactory<dynamic>' could be found (are you missing a using directive or an assembly reference?)

I believe I am using all the correct Kendo libraries. 

My declaration is as follows: 

    @(Html.Kendo().Notification().Name("popupNotification"))


I am using the following scripts and css files: 

<link href="@Url.Content("~/Content/bootstrap.css")" rel="stylesheet" type="text/css" /><br><link href="@Url.Content("~/Content/kendo/2014.1.416/kendo.common.min.css")" rel="stylesheet" type="text/css" /><br>    <link href="@Url.Content("~/Content/kendo/2014.1.416/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" /><br> <link href="@Url.Content("~/Content/kendo/2014.1.416/kendo.default.min.css")" rel="stylesheet" type="text/css" /><br> <link href="@Url.Content("~/Content/kendo/2014.1.416/kendo.dataviz.default.min.css")" rel="stylesheet" type="text/css" /><br><script src="@Url.Content("~/Scripts/kendo/2014.1.416/jquery.min.js")"></script><br><script src="@Url.Content("~/Scripts/kendo/2014.1.416/kendo.all.min.js")"></script><br><script src="@Url.Content("~/Scripts/kendo/2014.1.416/kendo.aspnetmvc.min.js")"></script><br><script src="@Url.Content("~/scripts/kendo.modernizr.custom.js")"></script><br><script src="@Url.Content("~/Scripts/kendo.web.ext.js")"></script><br><link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />


Any ideas? Thank you. 




Kiril Nikolov
Telerik team
 answered on 17 Jun 2014
8 answers
130 views
Hi,
Apologies in advance - just trying to get started with this, and to compound things, I'm new to WebAPI too.

I've taken the inline grid demo, and made a few adjustments.  I also used the MVC5 WebAPI template to create a new JSON service I could call, but can't seem to get it all working together.

The grid initializes properly, and does a GET to return and show the three rows.  However, when I attempt to update/create/delete, it always calls the POST method on the server, and the value passed is always unititialised.  Can someone please advise where I'm going wrong?

My model looks like this:

namespace WebAPI2.Models
{
public class Product
{
public int ProductID { get; set; }
public string ProductName {get;set;}
public int UnitPrice { get; set; }
public bool Discontinued { get; set; }
public int UnitsInStock { get; set; }
}
}

The controller:
namespace WebAPI2.Controllers
{
public class ProductsController : ApiController
{
Product[] products = new Product[]
{
new Product { ProductID = 1, ProductName = "Prod_1", UnitPrice = 1, Discontinued=false, UnitsInStock=1 },
new Product { ProductID = 2, ProductName = "Prod_2", UnitPrice = 2, Discontinued=true, UnitsInStock=2 },
new Product { ProductID = 3, ProductName = "Prod_3", UnitPrice = 3, Discontinued=false, UnitsInStock=3 },
};

// GET api/products
public IEnumerable<Product> Get()
{
return products;
}

// GET api/products/5
public Product Get(int id)
{
return products[id];
}

// POST api/products
public void Post([FromBody]Product value)
{
//just for a breakpoint
int i = 1;
}

// PUT api/products/5
public void Put(int id, [FromBody]Product value)
{
//just for a breakpoint
int i = 1;
}

// DELETE api/products/5
public void Delete(int id)
{
//just for a breakpoint
int i = 1;
}
}
}

And finally the client:
<div id="example">
<div id="grid"></div>

<script>
$(document).ready(function () {
var crudServiceBaseUrl = "http://demos.telerik.com/kendo-ui/service",
dataSource = new kendo.data.DataSource({
transport: {
read: {
//url: crudServiceBaseUrl + "/Products",
//dataType: "jsonp"
url: "http://localhost:63272/api/products",
dataType: "json",
type: "GET"
},
update: {
//url: crudServiceBaseUrl + "/Products/Update",
//dataType: "jsonp"
url: function (product) {
return "http://localhost:63272/api/products/" + product.ProductID;
},
dataType: "json",
type: "PUT"
},
destroy: {
//url: crudServiceBaseUrl + "/Products/Destroy",
//dataType: "jsonp"
url: function (product) {
return "http://localhost:63272/api/products/" + product.ProductID;
},
dataType: "json",
type: "DELETE"
},
create: {
//url: crudServiceBaseUrl + "/Products/Create",
//dataType: "jsonp"
url: "http://localhost:63272/api/products",
dataType: "json",
type: "POST"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
},
batch: true,
pageSize: 20,
schema: {
model: {
//id: "ProductID",
fields: {
ProductID: { editable: false, nullable: true },
ProductName: { validation: { required: true } },
UnitPrice: { type: "number", validation: { required: true, min: 1 } },
Discontinued: { type: "boolean" },
UnitsInStock: { type: "number", validation: { min: 0, required: true } }
}
}
}
});

$("#grid").kendoGrid({
dataSource: dataSource,
pageable: true,
height: 550,
toolbar: ["create"],
columns: [
"ProductName",
{ field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "120px" },
{ field: "UnitsInStock", title: "Units In Stock", width: "120px" },
{ field: "Discontinued", width: "120px" },
{ command: ["edit", "destroy"], title: "&nbsp;", width: "200px" }],
editable: "inline"
});
});
</script>
</div>


Thanks in advance for any help!

Bertha
Top achievements
Rank 1
 answered on 16 Jun 2014
3 answers
482 views
Hi,

I have a grid which display items. The items are refreshed depending in the selection of a comboBox. Some of the filters are dropdownlists that display options related to the current items in the grid.

Each time the selection of the comboBox is changed I need to change the items in the grid and the filters that were accessed.

When the dropdownlists are getting reseted/refreshed the height is resetting.

The setup of the column:
{ field: "DOSExceptionCategory", title: "DOS Exception Category", width: 150, locked: false, lockable: false, filterable: { ui: exceptionCategoryFilter }, headerAttributes: { style: "overflow: visible; white-space: normal" } }

The setup of the dropdownlist filter:

var ksslExceptionCategory = [];
 
function exceptionCategoryFilter(element) {
    ksslExceptionCategory.push({
        LocationID: selectedLocationId, Filter: element.kendoDropDownList({
            dataSource: {
                transport: {
                    read: {
                        dataType: "json",
                        url: "locations/getdosexceptioncategories",
                        data: function () {
                            return { locationID: parseInt($("#comboBoxLocation").val()) };
                        }
                    }
                }
            },
            dataTextField: "Text",
            dataValueField: "Value",
            optionLabel: "--Select Value--",
            height: 450
        }).data("kendoDropDownList")
    });
}

The setup in the columnMenuInit to reset the dropdownlist filter (some code is omitted here):

columnMenuInit: function (e) {
        var popup = e.container.data("kendoPopup");
        var field = e.field;
 
        popup.bind("open", function (e) {
            switch (field) {
                case "DOSExceptionCategory":
                    $.each(ksslExceptionCategory, function (i, element) {
                        if (element.LocationID != selectedLocationId) {
                            element.LocationID = selectedLocationId;
                            element.Filter.dataSource.read();
                        }
                    });
                    break;

Any help will be appreciated.

Thanks.
Alexander Popov
Telerik team
 answered on 16 Jun 2014
2 answers
5.1K+ views
Hi Guys,

We're looking for a way to control the odata query when we set a filter on the grid.
In fact our problem is that the grid is already bound to a datasource containing a $filter, (the odata query that populate the datasource and the grid is composed of a filter) so we can't add another one when trying to filtering the grid (Hope its clear enough)

Is there a way to change datasource.read.url when filtering  ? Or a way to get an event once the filtering is activated and then change the datasource real url ?

Any help/Advices on that could be great,

Thanks in advance,

Damien
Kiril Nikolov
Telerik team
 answered on 16 Jun 2014
11 answers
1.4K+ views
Hi,
Is there any direct way or work-around to text-wrap the axis labels for charts?
Thanks,
Suresh
Sebastian
Telerik team
 answered on 16 Jun 2014
4 answers
397 views
Hi:

I have  a selection list that I would like to apply a kendo style.
<select id="listView" size="10" style="width: 150px;"></select>
<script>
    $("#listView").kendoListView({
        dataSource: [
          { id: 1, name: "Apples" },
          { id: 2, name: "Oranges" },
          { id: 3, name: "Grapes" },
          { id: 4, name: "Bananas" }
        ],
        template: '<option value="#: id #">#: name # (#: id #)</option>',
        dataTextField: "name",
        dataValueField: "id"
    });
</script>

What class?

Phil
Kiril Nikolov
Telerik team
 answered on 16 Jun 2014
5 answers
350 views
Hello

I have viewModel that is created from remote dataSource

var viewModel = window.kendo.observable({
            dataSource: data.dataSource,
            dataBound: function() {
               // do something
            }
});

this view model is bound to list:

<div class="list edit-form"
            data-role="listview"
            data-source="{ 'pageSize': 5 }"
            data-bind="source: dataSource"
            data-auto-bind="false"
            data-template="list-line-template">
       </div>
       <div class="pager k-pager-wrap"
            data-role="pager"
            data-source="{ 'pageSize': 5 }"
            data-bind="source: dataSource"
            data-auto-bind="false">

Inside list there is nested sublist with is bound with:

<div class="form-group-indent" data-bind="source: SubList" data-template="list-subline-template">
               </div>

Everything is working except one thing, I need to run some code after all list is finished loading and finished binding: I tried

events: { dataBound: dataBound }

on list element, but this is fired too soon, before sublist is bound.
When I add the same in place where sublist is bound, the even is not fired, becuase I beleive it si trying to find function inside nested element, not on root.

So my question is how to add event handler to dataBound event from viewModel (parent), or is there any event that is called when everything is bound, all parent and child items to listview?

Regards
Marcin


Petur Subev
Telerik team
 answered on 16 Jun 2014
1 answer
1.0K+ views
Hello,

I am executing the inline add/edit. During inline add, I have a dropdown values which are pulled from database but when I click then not getting the default selected value in save operation, If change dropdown value and click on save then getting the dropdown value.

Thanks in advance.
Vladimir Iliev
Telerik team
 answered on 16 Jun 2014
3 answers
146 views
Hi

I have an issue with the paging block at the bottom of the grid (where pages numbers buttons and items number are located). At the first rendering of the page, this paging block is not initialized. My grid contains 2 pages of 5 items each but the paging block only displays 1 page button, with the number "0" and the text "No items to display".

If I sort the data (by clicking on a column header), the paging block is properly initialized.

I have no clue of what I'm doing wrong.

Here is my cshtml code :

$("#grid").kendoGrid({
    dataSource: {
        type: "json",
        transport: {
            read: "/Countries/AllCountries",
        },
        schema: {
            data: "data"
        },
        pageSize: 5
    },
    groupable: false,
    sortable: true,
    pageable: true,
    filterable: true,
});

Here is the result of my json request /Countries/AllCountries :

 
{"data":[
   {"Id":1,"Name":"Japan"},
   {"Id":2,"Name":"South Africa"},
   {"Id":3,"Name":"United States"},
   {"Id":4,"Name":"Albania"},
   {"Id":5,"Name":"Germany"},
   {"Id":6,"Name":"France"},
   {"Id":7,"Name":"Sweden"},
   {"Id":8,"Name":"UK"},
   {"Id":9,"Name":"Marocco"},
   {"Id":10,"Name":"Argentina"}]}


Thanks for helping
Syl'
Top achievements
Rank 1
 answered on 16 Jun 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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?