Telerik Forums
Kendo UI for jQuery Forum
1 answer
168 views

Hello,
I have colored rows in the left part of the Gantt like in this example http://dojo.telerik.com/ADaB/7. I want to add bottom border to the rows for splitting them.
If I add the following code in "dataBound" event

//add border to rows
gantt.element.find(".k-treelist .k-grid-content  tr td").each(function (e)
{
    this.style.borderBottom = "solid 1px #000000";
});

tasks' height between left and right Gantt parts becomes unsynchronized like here: http://dojo.telerik.com/ADaB/14.

When you uncomment code for adding borders to the right part of the Gantt
/*gantt.element.find(".k-gantt-rows tr td").each(function (e) {
                    this.style.borderBottom = "solid 1px #000000";
                });                gantt.element.find(".k-gantt-tasks tr td").each(function (e) {
                    this.style.borderBottom = "solid 1px #000000";
                  });*/
tasks' height between left and right parts becomes synchronized, BUT scroll down right part and see that table with css class ".k-gantt-columns" ends earlier (it has fixed height) than tables with classes ".k-gantt-rows" and ".k-gantt-tasks". Then scroll right part to the right and see that dependency arrows are moved from correct vertical position.

 

My goal is to split rows by boder in the left part. How can I do it???
The problem persists in the latest version of Kendo UI also. 

 

Bozhidar
Telerik team
 answered on 19 Jun 2015
1 answer
158 views

Hello,

posted in DataSource forum, nobody answers, maybe here is the right place.

In some demos & examples I found this : "stringifyDates": true  in the data source configuration, 

but didn't find anything in the documentation about this.

another thing on same subject,  I try to use the parameterMap , to parse the model sent to the server,and stringify the date in the model "SupplyDate": { "type": "date" }, but  its never called! please see example here.

var ds = new kendo.data.DataSource({
    "type": (function () { if (kendo.data.transports['aspnetmvc-ajax']) { return 'aspnetmvc-ajax'; } else { throw new Error('The kendo.aspnetmvc.min.js script is not included.'); } })(),
    "transport": {
        "read": {
            "url": '/Controller/Products_Get',
            "data": function () {
                return {
                    "OrderNumber": "0001"
                };
            },
            "complete": function (jqXHR, textStatus) {
                if (textStatus == "error") {
                    var msg = "read event completed with error. invalid url or other javascript error";
                    console.log(msg);
                } else {
                    var result = JSON.parse(jqXHR.responseText);
                    console.log("jqXHR.responseText:\n" + jqXHR.responseText, '#ffffff', '#0011cc');
                }
            }
        },
        "update": {
            "//type": "POST",
            //"dataType": "json",
            //"contentType": "application/json",
            "url": '/Controller/Product_Upsert',
            "complete": function (jqXHR, textStatus) {
                Parse_UpsertOrDelete_Complete("update", jqXHR, textStatus);
            }
        },
        "create": {
            //"type": "POST",             
            //"dataType": "json",
            //"contentType": "application/json",
            "url": '/Controller/Product_Upsert',
            "complete": function (jqXHR, textStatus) {
                Parse_UpsertOrDelete_Complete("create", jqXHR, textStatus);
            }
        },
        "destroy": {
            //"type": "POST",              
            //"dataType": "json",
            //"contentType": "application/json",
            "url": '/Controller/Product_Delete',
            "complete": function (jqXHR, textStatus) {
                Parse_UpsertOrDelete_Complete("destroy", jqXHR, textStatus);
            }
        },
        "stringifyDates": true,
        "prefix": "",
        "parameterMap": function (data, operation) {
  
            console.log("operation: " + operation + " data: " + JSON.stringify(data));
  
            if (operation === "update" || operation === "create" || operation === "destroy") {
                return JSON.stringify({ entity: data });                  
            }
            return data;
        }
    },
    "pageSize": 1000,
    "page": 1,
    "total": 0,
    "serverPaging": true,
    "serverSorting": true,
    "serverFiltering": true,
    "serverGrouping": true,
    "serverAggregates": true,
    "filter": [],
    "error": function (jqXHR) {
        console.log("jqXHR.status =" + jqXHR.status);
    },
    "schema": {
        "data": "Data",
        "total": "Total",
        "errors": "Errors",
        "model": {
            "id": "OrderNumber",
            "fields": {                                      
                "OrderNumber": { "type": "number" },
                "SupplyDate": { "type": "date" },                  
                "CustomerName": { "type": "string" },                  
                "Units": { "type": "number" }
            }
        }
    }
});


function Parse_UpsertOrDelete_Complete(action, jqXHR, textStatus) { // handle complete...}

 

 

 Controller

class ProductEntity {
    public int OrderNumber {get;set;}
    public DateTime SupplyDate {get;set;}                  
    public string CustomerName {get;set;}                
    public int Units {get;set;}
}
  
[AcceptVerbs(HttpVerbs.Post)]
public async Task<ActionResult> Product_Upsert([DataSourceRequest]DataSourceRequest request,
                   ProductEntity entity)
{
  
        ProductEntity product =  entity;
  
        // product.SupplyDate  not set correctly when not using
        //  (   "stringifyDates": true  in the DataSource )
  
           
}

 

Thanks

 

Rosen
Telerik team
 answered on 19 Jun 2015
3 answers
492 views

I'm trying to add a custom drop event to each tree view node so that I can handle the 'drop' event when a file is dropped onto the node element from Windows File Explorer.  My html code (with the style section removed) looks like this:

 

<div id="example">
        <div class="demo-section k-header">
            <div class="box-col" style="width: 300px">
                <h4>Select a node</h4>
                <div class="files"
                     data-role="treeview"
                     data-drag-and-drop="false"
                     data-text-field="name"
                     data-spritecssclass-field="type"
                     data-bind="visible: isVisible,
                            source: files,
                            events: { dataBound: onDataBound }"></div>
            </div>
        </div>
        
        <script>
            $(document).ready(function ()
            {
                $("#treeview").kendoTreeView();
            });
        </script>
    </div>

 

I'm binding the view model like this:

<script>
    var viewModel = kendo.observable({
        isVisible: true,
        onDataBound: function (e)
        {
            if (e.node)
            {
                var dataItem = e.sender.dataItem(e.node);
 
                dataItem.bind('drop', function (e1)
                {
                    alert('dropped on item');
                });
            }
        },
        files: kendo.observableHierarchy(jobBookAPI.directoryContents)
    });
    kendo.bind($("#example"), viewModel);
 
</script>

My data looks like this:

var jobBookAPI = new function ()
{
    // Public data
 
    this.directoryContents =
        [
            {
                name: "My Web Site", type: "folder", expanded: true, items:
                [
                    {
                        name: "images", type: "folder", expanded: true, items:
                        [
                            { name: "logo.png", type: "image" },
                            { name: "my-photo.jpg", type: "image", id: 12345 }
                        ]
                    },
                    {
                        name: "resources", type: "folder", expanded: true, items:
                        [
                            { name: "resources", type: "folder" },
                            { name: "zip", type: "folder" }
                        ]
                    },
                    { name: "about.html", type: "html" },
                    { name: "index.html", type: "html" }
                ]
            }
        ];
 
};
 

 

The drop event does not fire when I drag a file onto a node.  I've tried replacing 'drop' with 'click' just to see if I can fire a click event, but that event doesn't fire when a node is clicked.  I think that what I'm trying to do should be possible because I've use this same method with simple DIV elements and files dropped on them from File Explorer cause the drop event to fire perfectly.

Any ideas what I'm doing wrong?

Thanks. 

 

 

T. Tsonev
Telerik team
 answered on 19 Jun 2015
1 answer
121 views
That would be very handy. Are there any plans to implement that in the near future?
Kiril Nikolov
Telerik team
 answered on 18 Jun 2015
3 answers
309 views

I am using a grid with an odata datasource.

 When I enable serverSorting and serverFiltering it isn't working. For some reason the endpoint (Azure Mobile Service .net Backend) returns a bad request when the $'s are encoded.

For example, here is a request with the $ encoded:

GET /tables/members?%24inlinecount=allpages&%24top=50&%24orderby=memberNumber

For some reason, that returns bad requst: message=The query specified in the URI is not valid. Could not find a property named 'memberNumber' on type 'myapi.DataObjects.Members'.

But, if I take the same request from fillder into the composer and change it to:

GET /tables/members?%24inlinecount=allpages&%24top=50&$orderby=memberNumber 

I get a 200 response and the grid binds to the data no problem.

I tried to set processData to false, but that just sends like [object:object] on the Url.

Any idea how I can prevent the $'s from being encoded? Or, how I can turn them back to $, perhaps in the beforeRequest method?

 

 

 

Bob
Top achievements
Rank 1
 answered on 18 Jun 2015
4 answers
597 views

I have a treeView with checkable nodes and a couple of buttons with which I can "check all" and "check none".

These buttons run through dataSource.data() and and call set('checked', true) or set('checked', false) on each node.

 This all works well until I start filtering the dataSource by its 'checked' state:

dataSource.filter({ field: 'checked', operator: 'eq', value: true });

When the filter is on (means I want to only see the checked items), and I click on "check none", I would like all the items in the treeview to dissapear (which is what the datasource tells me when I look at dataSource.view(): it contains 0 items). When I click on "check all", I would like all the items in the treeview to appear. Also, when I uncheck an individual item, I would like it to dissapear immediately.

I can accomplish that with re-setting the filter, but the problem is that this takes ages. With a treeview of 1300 items (and this is without any children loaded), resetting the filter takes almost 10 seconds!

Is there a better - or rather usable - way to refresh the treeview's filter after a node has been checked/unchecked?

Alexander Popov
Telerik team
 answered on 18 Jun 2015
13 answers
716 views
Hello,

How can I localize the Scheduler?

Thanks,
Koen
Vladimir Iliev
Telerik team
 answered on 18 Jun 2015
2 answers
471 views

Hi,

 After a lot of searching I found out how to get group-level and grand-total aggregates working.  

 However, now that is in place, I find that changing the grouping via the GUI blows up.  

I guess this makes sense since the aggregation is set as a static object, but this must be a common requirement surely?  I want to have group level aggregates and the grand total continue to work even if the user wants different grouping.

 I've created a JSFiddle to focus any help people can offer.

I suspect this may involve my catching a grid event but I welcome any suggestion.  I can reference an object as the datasource group attribute.

var grouping = {
    field: "deal.dealStatus",
    aggregates: [{
        field: "valueUSD",
        aggregate: "sum"
    }]
};
 
 
 
    dealDataSource = new kendo.data.DataSource({
        ...
        aggregate: [
            { field: "valueUSD", aggregate: "sum" }
        ],
        //group: function () {
        //    return {
        //        field: "deal.dealStatus",
        //        aggregates: [{
        //            field: "valueUSD",
        //            aggregate: "sum"
        //        }]
        //    };
        //},
        group:grouping,

Is this the way to go?  To dynamically change "grouping" based on grouping changes?

 

 Thanks

Chris

 

Rosen
Telerik team
 answered on 18 Jun 2015
1 answer
124 views

Hi Support,

 

Is there any pinchin and pinchout gesture in KendoUI?

If yes, where can I find the documentation on this?

If no, how do I simulate this gesture?

I really appreciate if you response to this as quick as possible. 

Many thanks in advance.

Petyo
Telerik team
 answered on 18 Jun 2015
1 answer
140 views

I am trying to make the category field of a template, that when in edit mode turns into a dropdown box that lists all the available categories. Is there a simple way to do this?

 I would like to keep the dropdown hidden until the field is actually edited.

 

This is my current template: 

<script id="rowTemplate" type="text/x-kendo-template">
        <tr class="k-master-row" data-uid=#: uid #> 
            <td class="k-hierarchy-cell">
                <a href="\\#" class="k-icon k-plus" title="transaction details"></a>
            </td>
            <td>#= kendo.toString(transactionDate, 'MM/dd/yyyy') #</td>
            <td>#: description.description #</td>
            <td>#: category.categoryName #</td>
           <td>#: account.accountName #</td>
            <td class="currencyField">#=kendo.toString(amount.amount, 'c') #</td>
            <td class="tId">#: transactionBaseType #</td>
            <td>
              <a class="k-button k-button-icontext k-grid-edit" href="\#">
                <span class="k-icon k-edit"></span>Edit
              </a>
            </td>
        </tr>
    </script>

Daniel
Telerik team
 answered on 18 Jun 2015
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
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
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?