Telerik Forums
Kendo UI for jQuery Forum
1 answer
831 views
How to stop popup a custom window?I use " e.preventDefault();" on edit event but it does not work,the edit window still popup.
Like this  sample,   I click the "Edit" button,  and popup the edit window.But sometimes I click the "Edit" button, but do not want to popup the custom window,I  want to alert("Can not edit"). I just want to popup the edit window when the Product Name is  "Chang" or  hide the "Edit" button when ProductName is not "Chang"
Alexander Valchev
Telerik team
 answered on 12 Aug 2013
4 answers
590 views
Hi,
I am using kendo charts in my application and through the button I am launching a popup to print the chart. Sometimes, the size of the chart is bigger than the content area of the pop up and it shows scrollbars, and beacause of the scrollbars I am not able to print the entire contents of the chart.

 Please let me know how I can resize the chart before printing it.

Thank you,

Poonam
Iliana Dyankova
Telerik team
 answered on 12 Aug 2013
1 answer
168 views
I'm trying to follow the example for populating the grid with remote data.  I've setup my controller to accept the DataSourceRequest param and, per the example, am getting the data from the DB and then calling ToDataSourceResult - which I assume will do the skip/take/count.

A little more detail:
I'm making a call to the DB using EF and calling an SP (not with "using db context" around call so the connection stays open after I return to the controller so the controller can do the skip/take/count).  Once the DB call is complete, I have ObjectResult<MyEntity_Result>.  I then select from this ObjectResult<> into an anonymous type and then call ToDataSourceResult.  The error I get is: "The result of a query cannot be enumerated more than once."

Now, if I call ToList() after I have selected my anonymous type from the ObjectResult<>, but before I call ToDataSourceResult, everything works well.  But, why would I want to call ToList(), especially if I have tons of data?

Second issue: Once I put ToList() on there and am getting data back, the grid isn't showing the data.  When I return the data without the ToDataSourceResult, and do my own skip/take I get data (but of course, I can't get count in addition to the skip/take since it will enumerate twice and throw an exception).  And if I do my own skip/take, the paging doesn't show more than one page when I know there are at least 10,000 records.

Here is the AJAX Controller Action method:

public JsonResult LoadAllUsers([DataSourceRequest]DataSourceRequest request)
{
    var repo = new AdminRepository();
    var users = repo.LoadAllUsers();
    var resp = users.Select(u => new
        {
            u.UserId,
            u.UserName,
            u.FirstName,
            u.LastName,
            u.EmailAddress,
            u.LastActivityDate,
        });
    var data = resp.ToList().ToDataSourceResult(request);
    // var data = resp.Skip(20).Take(20).ToList();
    return Json(data, JsonRequestBehavior.AllowGet);
}

Here is the js that is output:

$('#grid').kendoGrid({dataSource: {transport: {read: '/AdminJson/LoadAllUsers'},schema: {model: {fields: {UserId: { type: 'number' },UserName: { type: 'string' },FirstName: { type: 'string' },LastName: { type: 'string' },EmailAddress: { type: 'string' },LastActivityDate: { type: 'date' }}}},pageSize: 20,serverPaging: true,serverFiltering: false,serverSorting: true,scrollable: true},height: 430,pageable: true,filterable: false,sortable: true,columns: [{ field: 'UserId', title: 'User ID', sortable: false, filterable: false, groupable: false },{ field: 'UserName', title: 'User Name', sortable: true, filterable: false, groupable: false },{ field: 'FirstName', title: 'First Name', sortable: true, filterable: false, groupable: false },{ field: 'LastName', title: 'Last Name', sortable: true, filterable: false, groupable: false },{ field: 'EmailAddress', title: 'Email Address', sortable: true, filterable: false, groupable: false },{ field: 'LastActivityDate', title: 'Last Activity Date', sortable: true, filterable: false, groupable: false, format: '{0: yyyy-MM-dd HH:mm:ss}' }]});
Atanas Korchev
Telerik team
 answered on 12 Aug 2013
1 answer
83 views
Good morning.

I have a trouble using Kendo to make indexed list with local data for over a week.
The Kendo Music Store shows it, but it is for the remote data source. What I want is using local data.
I managed to make one, but it doesn't work. Only after resizing once, it works.
I tried to find a solution and stayed up all night over a week, but did not find it.
So, I put a point on the library files (kendo.min.js, etc).. as the one used in Kendo Music Store is not a recent one.
So I tried to use the older versions of kendo js files, but I can't find them neither.

I hope the master kendo programmers help me with this, and especially with the indexed list with local data problem.
Thank you.
Alexander Valchev
Telerik team
 answered on 12 Aug 2013
1 answer
120 views
Good morning.

I have a trouble using Kendo to make indexed list with local data for over a week.
The Kendo Music Store shows it, but it is for the remote data source. What I want is using local data.
I managed to make one, but it doesn't work. Only after resizing once, it works.
I tried to find a solution and stayed up all night over a week, but did not find it.
So, I put a point on the library files (kendo.min.js, etc).. as the one used in Kendo Music Store is not a recent one.
So I tried to use the older versions of kendo js files, but I can't find them neither.

I hope the master kendo programmers help me with this, and especially with the indexed list with local data problem.
Thank you.
Alexander Valchev
Telerik team
 answered on 12 Aug 2013
1 answer
123 views
Is kendo UI compatible with jquery mobile?
I want to use a date widget(mobile friendly, I know we have one in kendo as well), but it uses jquery mobile 1.3.2
I see a weired behavior, right after the login, i get redirected to the IIS7 welcome.png image.  So basically i cannot access my website.

Thanks
Kiril Nikolov
Telerik team
 answered on 12 Aug 2013
1 answer
238 views
When there are multiple category axes and negative values are present on a column chart, the axis labels collapse down to one line rather than being stacked as normal.  For example:

element.kendoChart({
seriesDefaults: {
type: "column"
},
series: [{
name: "Sales",
data: [10, 20, -0.5, 0, 100, 0],
}],
valueAxis: [{
majorGridLines: { visible: false },
title: { text: "Sales" },
}],
categoryAxis: [{
categories: ["Order", "Invoice", "Credit Memo", "Order", "Invoice", "Credit Memo"],
majorGridLines: { visible: false },
}, {
categories: ["Item", "Resources"],
line: { visible: false },
majorGridLines: { visible: false },
title: { text: "Type & Document Type" },
}],
});

Note that the 2 category axes labels simply collapse on top of one another with the words "Item" and "Invoice" on top of one another and the words "Resources" and "Invoice" on top of one another.  If I change the 3rd value in the series data from -0.5 to just 0.5, then the problem goes away and the 2 category axes are displayed correctly, one above the other.

This behavior seems like a bug since the axes are displayed correctly when the chart contains just positive values, but not if a negative value is present.  Is there some setting I'm missing?

Regards,
Hughes
Iliana Dyankova
Telerik team
 answered on 12 Aug 2013
1 answer
128 views
Does the DS have any way for me to capture and handle jsonp errors?

Is there a best practice?

I've tried this, but nothing happens (no alerts)

dataSource: new kendo.data.DataSource({
                    serverFiltering: true,
                    transport: {
                        read: {
                            url: function (e) {
                                var value = $("#activityTypeBox").data("kendoDropDownList").value();
 
                                if (value != "") {
                                    return "http://site/api/activities/getByType/id/" + value + "/format/jsonp"
                                }
                            },
                            dataType: "jsonp",
                            jsonpCallback: 'myCallback'
                        },
                        parameterMap: function (data, type) {
 
                        }
                    },
                    schema: {
                        errors: "error" // ex: twitter's response is { "error": "Invalid query" }
                    },
                    error: function (e) {
                        alert("Problem populating the curriculum db activities based on that type");
                    }
                })

Atanas Korchev
Telerik team
 answered on 12 Aug 2013
2 answers
160 views
Hi,

I'm trying to bind the grid with a call from WebApi controller based on the project described in this blog post http://www.kendoui.com/blogs/teamblog/posts/12-11-29/the_facts_on_using_kendo_ui_with_asp_net_webapi.aspx . It's actually hitting the method in ApiContoller but the dataRequest is coming as null from and it's never hitting the ModelBinder code.

Code snippets from cshtml and controller are below:
cshtml:
  @(Html.Kendo().Grid<ABC>()
                          .Name("grdEngagements" + Model.UniqueId)
                          .HtmlAttributes(new { Class = "telerikGrid" })
                          .AutoBind(Model.GridAutoBind)
                          .Columns(columns =>
                              {
                                  columns.Bound(p => p.Prop1).HeaderTemplate("Header").Width(80);
                                  columns.Bound(p => p.Prop2).Width(280);
                                  columns.Bound(p => p.Prop3);
                              })
                          .Pageable(p => p.Messages(m => m.Display("{0} to {1} of {2}")))
                          .Sortable()
                          .Scrollable()
                          .Events(e => e.DataBound("gridNoDataMsgDisplay"))
                          .DataSource(dataSource => dataSource
                                                        .Ajax()
                                                        .Model(model => model.Id(p => p.EntityId))
                                                        .Sort(s => s.Add(t => t.Prop3).Descending())
                                                        .Read(read => read
                                                                          .Action("ApiControllerAction", "ApiController")
                                                                          .Type(HttpVerbs.Get).Data("grdEngagementsAjaxReadAdditionalFilterData" + Model.UniqueId))
                          ))

Controller

 //see telerik sample app Grid CustomAjaxBinding for details on how this works
        public JsonResult ApiControllerAction([ModelBinder(typeof(ModelBinders.DataSourceRequestModelBinder))] DataSourceRequest dataSourceRequest, string searchText, bool includeAll)
        {
            var request = dataSourceRequest.ToDataRequest();  // blows up at this point because dataSourceRequest is null
            var sortText = GetSortString(request.Sorts);
            return service.GetABC(request, searchText, sortText, includeAll)
                .ToKendoJsonResult<ABCServer, ABC>();
        }
Manoj
Top achievements
Rank 1
 answered on 12 Aug 2013
1 answer
115 views
Hey guys,
I'm new to Kendo UI. This is basically my first post on forum. I'm on trial version now. I have  a few questions about customizing of column charts.

This is the database in MS SQL that I'm mapping.
[url=http://ifotos.pl/zobacz/1png_neepeqr.png/][img]http://s6.ifotos.pl/mini/1png_neepeqr.png[/img][/url]
This is my controller:
public ActionResult Index()
{
IList<CzasPracyMaszyn> CzasPracyMaszyn = _repository.GetCzasPracyMaszyn();
return View(CzasPracyMaszyn);
}
 
My model:
public class CzasPracyMaszyn
{
public virtual int ID { get; set; }
public virtual string STANOWISKO { get; set; }
public virtual int CZASPRACY { get; set; }
}

and my view:
@model IEnumerable<CMMS_Aplixcom_alfa.Models.CzasPracyMaszyn>

@(Html.Kendo().Chart(Model)
      .Name("aa")
        .Title("aaa")
      .Series(series => {
          series.Column(model => model.CZASPRACY).Name("Czas Pracy");
      })
      .CategoryAxis(axis => axis
          .Categories(model => model.STANOWISKO)
 
        )
)
This is the chart I'm getting.
[url=http://ifotos.pl/zobacz/2png_neepeqa.png/][img]http://s6.ifotos.pl/mini/2png_neepeqa.png[/img][/url]

Now I am able to turn of/ turn on Columns using the box on the right. But I would like to do that for each record in the database separately.




Iliana Dyankova
Telerik team
 answered on 12 Aug 2013
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
Iron
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
Iron
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?