簡體   English   中英

使用AngularJs和WebApi創建Kendo UI網格

[英]Create Kendo UI grid using AngularJs and WebApi

使用angular和Web API(用於后端)創建Kendo UI網格的最佳方法是什么? 我正在使用MVC結構。 我的模型如下:

public class Category
{

    [Key]
    public int CategoryID { get; set; }
    [Required]
    public string CategoryName { get; set; }
}

在Web API控制器中,我有以下方法:

public IEnumerable<Category> GetCategories() {}
public HttpResponseMessage PostCategory(Category category) {}
public HttpResponseMessage PutCategory( Category category) {}
public HttpResponseMessage DeleteCategory(Category category) {}

現在,我希望使用angular實現kendo ui網格。 我怎樣才能做到這一點? 我閱讀了kendo ui演示: http : //demos.telerik.com/kendo-ui/grid/angular和文檔,但是我不知道如何實現。 謝謝。

我在這里的一個問題中附有一個最有效的示例

AngularJS劍道網格綁定到角度服務webapi-使用[fromuri]解析時,排序始終為null

如果您將服務網址直接附加到dataSource.transport上,而不是使用像我那樣的服務,那您應該就很好了。...

只需取出我的read:xxxxx部分並替換為

read: {
  url: "YourWEBAPIURL",
  dataType: "json" 
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM