Telerik Forums
Kendo UI for jQuery Forum
2 answers
123 views

I have two issues with the following 100% stacked area chart:

http://jsbin.com/dofuxudome/1/edit?js,output

1) How can I sort the data source so that second sort field is used?

2) How can I color the areas using the colorField?

Morten
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 30 Dec 2016
5 answers
1.5K+ views

Hi~

I tried to save Grid data in Json format and send it back to controller to combine new query result, then return

back to Grid together.

My controller could get Json result from javascript as string, but the controller return format require .ToDataSourceResult

However, when I return string.ToDataSourceResult, it shows error.

How could I fix this?

public ActionResult ChemicalTestResult_Read([DataSourceRequest] DataSourceRequest request, string param1, string displayedDataAsJSON)
{
    try
    {
        if (param1 != null && param1 != "")
        {
            var TestId = param1.Split(',').Reverse().ToList();
            return Json(db.LIMS_Chemical_TestResult.Where(o => param1.Contains(o.TestId) && (o.Result_1 == null || o.Result_2 == null || o.Result_3 == null) && (o.isPermitted == "不合格" || o.isPermitted == null)).ToDataSourceResult(request));                   
        }
        else
        {
            return stringdisplayedDataAsJSON.ToDataSourceResult(request);
        }
    }
    catch (Exception ex)
    {
        logger.Error(ex, "ChemicalTestResultController");
        return new JavaScriptResult { Script = "alert('" + ex.ToString() + "');" };
    }
}
var displayedData = $("#grid").data().kendoGrid.dataSource.view()
var displayedDataAsJSON = JSON.stringify(displayedData);

Alexander Popov
Telerik team
 answered on 30 Dec 2016
5 answers
591 views

I need the element start and end time and the target resource after dragging it to a new position.

Your examaple: http://demos.telerik.com/kendo-ui/scheduler/restriction works quite well, but only if using the "moveEnd" event handler .

It seems that when registering kendoDropTargetArea, its "drop" event handler overwrites the "moveEnd" event handler of the scheduler.

The problem is that the object "e" as recieved by the drop doesnt have start, end and resources.

example:

scheduler.view().content.kendoDropTargetArea({

        filter: ".k-scheduler-table td, .k-event",
        drop: function(e){

           // get start, end and resource

        }
});

$("#scheduler").kendoScheduler({

..

        moveEnd: function(e){

            // never gets here

        }

});

 

 

 

Venelin
Top achievements
Rank 1
 answered on 30 Dec 2016
1 answer
104 views

Hello, 

I am loading a large list with checkboxes, some of the nodes have several subnodes checked and the data is peristed in a database.

I am using on demand loading with ajax json calls.

I can set the checkbox to true or false, but is there a way to set it to indetermined?

Veselin Tsvetanov
Telerik team
 answered on 30 Dec 2016
2 answers
873 views

Hello, I am struggling with a weird error while canceling a newly inserted row in a grid. Please help.

Below is a simplifed version of my code (http://jsfiddle.net/m2s59mpo/5/)

var myGrid = $("#my-table-grid").kendoGrid({
  toolbar: [ {
                    name: "create",
                    text: "Create"
                } ],
  editable: { mode: "inline", confirmation: false },
 
  columns: [
    { field: "name" },
    { field: "age" },
    { command: [{ name: "edit"}] }
  ],
  dataSource: {
    //data: [],
    data: {"a": []},   
    schema: {
      data: "a",
      model: { id: "id",
          fields: {
             id: {type: "number"},
             name: {type : "string"},
             age: {type: "number"},
          }}
    }
  },
});

 

Steps to reproduce:

1. Click the "Create" button to insert a new row.

2. Fill in any data and click "Update" to save the row.

3. Click the "Create" button to insert a second row.

4. Click "Cancel" button right away without filling in any data in the second row.

Sympton:

The second row will NOT be canceled. Error message "Uncaught TypeError: Cannot read property 'uid' of undefined" is shown in the console.

 

This issue will not occur for the first row added (You can cancel the first row). Also, if I do not specify the data field in the dataSource section (http://jsfiddle.net/m2s59mpo/6/), it works fine too. In my real case, the data comes from a API call with structured JSON data so this is not an option for me.

 

I wonder if I misconfigured something or this is a bug. Please help. Thanks a lot in advance.

Rak
Top achievements
Rank 1
 answered on 30 Dec 2016
3 answers
419 views

Hello 

Telerik, please correct me if I'm wrong in any case.

I want to simply exchange one menu item by another one. A simple use case is a state change like "Show Tooltips" and "Hide Tooltips". For this scenario I saw two possibilites:

1. Replace menu text visa versa
2. Add new menu element after existing element and then remove first element

Replace menu text visa versa
This approach took me a while. With JQuery its a singe line, assuming you are using JQuery. Switching menu text only will visually screw up your menu element. This will happen because you remove also a class that was initially set on the element by defining the menu. So therefore you need to add the class again as well: 

$('#hidetip').html('<span class="k-link">Tooltips anzeigen</span>');

 

-> Pretty simple, you just need to know it.

Hint: Use an additional attribute on the menu element like "state" (hidden, visible) to check/set its current state

 

Add new menu element after existing element and then remove first element

There is a menu function available called insertAfter that is obvious to use in this case. The main problem here is that you can't attach an ID or classes that way. I tried this:

var mainmenu = $("#mainmenu").data("kendoMenu");
mainmenu.insertAfter(
        {id: "showtip", text: "Show tooltips"},
        "#hidetip"
);

-> Text was attached but not the ID.

Another one I tried after finding this forum entry: See here

var mainmenu = $("#mainmenu").data("kendoMenu");
mainmenu.insertAfter(
        {text: "<li id='showtip'>Show tooltips</li>",
            encoded: false}, // to interpret text as HTML not as pure text
        "#hidetip"
);

-> Text of element will be screwed up again inside menu. My initial thought was to add the class again:

{text: "<li id='showtip'><span class='k-link'>Show tooltips</span></li>",
    encoded: false},

-> Text inside menu is still screwed up and a further (empty) line was added after "Show tooltip" item (with the span class). Maybe I did something wrong here, just dunno what. I can live with the first solution.

 

 

Tayger
Top achievements
Rank 1
Iron
Iron
 answered on 29 Dec 2016
1 answer
142 views

We have an app based on the Kendo UI Mobile framework. It makes heavy use of widgets like the kendoMobileView, kendoMobileLayout, etc, all wrapped in a kendoMobileApplication.  Is there a recommended path to upgrade this stack to support the move to Angular 2? I'm most concerned with the app state management and the ability of making headers and footers sticky and persistent between views by using a layout. Burke Holland's article seems to suggest moving over to Bootstrap but it's been difficult to find definitive answers. 

Dimiter Topalov
Telerik team
 answered on 29 Dec 2016
1 answer
84 views

I have found out a bug/typo in Kendo 2016.1.226 - in a few places, the variable "toConnector" is misspelled as "toConenctor" (note - one "n" is to the right of the "e").  

 

The type can be found in kendo.dataviz.min.js, kendo.dataviz.diagram.min.js etc. I'm not sure if it causes any noticeable bugs, but I couldn't find info confirming it was fixed.  

Regards, 
Itai. 

Vessy
Telerik team
 answered on 28 Dec 2016
9 answers
713 views
Hi,

Kendo does not seem to work with the current JQuery release (1.9.1), only with the bundled jquery.js.

If I just load 1.9.1, I get 

"Reference Error: jQuery is not defined"
"Reference Error: $ is not defined"

Boyan Dimitrov
Telerik team
 answered on 28 Dec 2016
1 answer
528 views

I am using the javascript kendo grid and applying a custom filter for the year of 2015.  This is my code

 

//Filter by Year
        $('#year').on('change', function() {
            var grid = $("#grid").data("kendoGrid");
            var val = this.value;
            var fd = new Date(val, 0, 1);
            var firstday = fd;
            var ld = new Date(val, 11, 31);
            var lastday = ld;
            grid.dataSource.filter({
                logic: "and",
                filters: [
                    { field: "CheckDate", operator: "gte", value: firstday },
                    { field: "CheckDate", operator: "lte", value: lastday }
                ]
            });
        });

 

The last date of the year is set as filter 12/31/2015. However, when the filter is applied it doesn't return any of the items with the 12/31/2015.  It returns everything else but anything with the last date of the year.

Dimiter Topalov
Telerik team
 answered on 28 Dec 2016
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
Styling
ColorPicker
Pager
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
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
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?