Telerik Forums
Kendo UI for jQuery Forum
0 answers
91 views
Is that possible to make first column title/heading as what ever we selected from drop down. For example :- If a serial number is searched , serial number should be in the first column of the search. But I am unable to get that since we defined column definition generically in sorted manner. Depending upon selection we hide rest of the column. for example:

xxx.xxxColDef = [ {
    field : "serialNo",
    title : "Serial No",

}, {
    field : "firstname",
    title : "firstname",
    }, {
    field : "lastnameo",
    title : "lastname",
    },


from the drop down if i select first name the first name should be in the first column. but i am getting first column as serial no Is there any way? without adding separate column definition for each.this should be done automatically not using column re-ordering not manually
Vinodh
Top achievements
Rank 1
 asked on 13 Oct 2012
1 answer
489 views
Hi,

Does anyone know if there is an obvious configuration entry that would do this, before I start delving into it more.

Currently my URL to the ODATA service is using the following

/_vti_bin/listdata.svc/Inventory?take=5&skip=0

It needs to have the dollar signs before each of the parameters for it to work.

Any ideas?

Cheers

My custom odata file

/*
* Kendo UI Web v2012.1.322 (http://kendoui.com)
* Copyright 2012 Telerik AD. All rights reserved.
*
* Kendo UI Web commercial licenses may be obtained at http://kendoui.com/web-license
* If you do not own a commercial license, this file shall be governed by the
* GNU General Public License (GPL) version 3.
* For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html
*/
(function($, undefined) {
    var kendo = window.kendo,
        extend = $.extend,
        odataFilters = {
            eq: "eq",
            neq: "ne",
            gt: "gt",
            gte: "ge",
            lt: "lt",
            lte: "le",
            contains : "substringof",
            endswith: "endswith",
            startswith: "startswith"
        },
        mappers = {
            pageSize: $.noop,
            page: $.noop,
            filter: function(params, filter) {
                if (filter) {
                    params.$filter = toOdataFilter(filter);
                }
            },
            sort: function(params, orderby) {
                params.$orderby = $.map(orderby, function(value) {
                    var order = value.field.replace(/\./g, "/");


                    if (value.dir === "desc") {
                        order += " desc";
                    }


                    return order;
                }).join(",");
            },
            skip: function(params, skip) {
                if (skip) {
                    params.$skip = skip;
                }
            },
            take: function(params, take) {
                if (take) {
                    params.$top = take;
                }
            }
        },
        defaultDataType = {
            read: {
                dataType: "jsonp"
            }
        };


    function toOdataFilter(filter) {
        var result = [],
            logic = filter.logic || "and",
            idx,
            length,
            field,
            type,
            format,
            operator,
            value,
            filters = filter.filters;


        for (idx = 0, length = filters.length; idx < length; idx++) {
            filter = filters[idx];
            field = filter.field;
            value = filter.value;
            operator = filter.operator;


            if (filter.filters) {
                filter = toOdataFilter(filter);
            } else {
                field = field.replace(/\./g, "/"),


                filter = odataFilters[operator];


                if (filter && value !== undefined) {
                    type = $.type(value);
                    if (type === "string") {
                        format = "'{1}'";
                        value = value.replace(/'/g, "''");
                    } else if (type === "date") {
                        format = "datetime'{1:yyyy-MM-ddTHH:mm:ss}'";
                    } else {
                        format = "{1}";
                    }


                    if (filter.length > 3) {
                        if (filter !== "substringof") {
                            format = "{0}({2}," + format + ")";
                        } else {
                            format = "{0}(" + format + ",{2})";
                        }
                    } else {
                        format = "{2} {0} " + format;
                    }


                    filter = kendo.format(format, filter, value, field);
                }
            }


            result.push(filter);
        }


        filter = result.join(" " + logic + " ");


        if (result.length > 1) {
            filter = "(" + filter + ")";
        }


        return filter;
    }


    extend(true, kendo.data, {
        schemas: {
            odata: {
              type: "json",
              data: "d.results",
              total: "d.__count"
          }        
        },
        transports: {
          odata: {
              read: {
                  cache: true, // to prevent jQuery from adding cache buster
                  dataType: "jsonp",
               //   jsonp: "$callback"
              },
              parameterMap: function(options, type) {
                  type = type || "read";
 
                  var params = {
                          $inlinecount: "allpages"
                      },
                      option,
                      dataType = (this.options || defaultDataType)[type].dataType;
 
                  options = options || {};
 
                  for (option in options) {
                      if (mappers[option]) {
                          mappers[option](params, options[option]);
                      } else {
                          params[option] = options[option];
                      }
                  }
                  return params;
              }
          }
      }        
      }
    });
})(jQuery);

My datasource parameters

var dataSource = new kendo.data.DataSource({
type: "odata.sharepoint",
transport: {
read:
{
url: "_vti_bin/listdata.svc/Inventory",
contentType: "application/json; charset=utf-8" ,
type: "GET",
dataType: "json"
}
},
schema: {
data: "d.results",
total: "d.__count",
model: {
fields: {
Make: { type: "string" },
Model: { type: "string" },
Price: { type: "number" },
PictureUrl: { type: "string" }
}
}
},
pageSize: 5,
serverPaging: true,
serverFiltering: true,
serverSorting: true
});



Jeff
Top achievements
Rank 1
 answered on 12 Oct 2012
1 answer
255 views
I am trying to highlight a range of acceptable values on the value axis of a line chart.  I initially thought of adding a series with the data property set to a single value, but this produces a bar on the chart rather than a line at y = k.  Ultimately I am displaying blood glucose readings and need to show the values' relationship to the normal high and low.

Any ideas are appreciated.
Iliana Dyankova
Telerik team
 answered on 12 Oct 2012
1 answer
171 views
I've attached a PNG that shows my issue. I have inspected it with Chrome's debugging tools and cannot seem to find the issue.

This control is within a SharePoint 2010 customized EditForm. I would be thankful for any help anyone can give.

If for any reason you cannot see th image the pager basically looks like this.

<<
1 2  >>

And not

<<  1 2  >>
Dimo
Telerik team
 answered on 12 Oct 2012
2 answers
317 views
Hi,

I have requirements that date should be presented in the browser based on the user system settings in "Region and Language -> Formats -> Short Date", so in US it should be "M/d/yyyy" and in Bulgaria it should be "d.M.yyyy".  I know that Kendo UI supports localization, but I could not figure out how to do that.

This date should be presented in grid and I am using ASP.NET MVC 4.0 with Kendo UI MVC grid control.

Thanks for help.

Thanks.
Vlad
Top achievements
Rank 1
 answered on 12 Oct 2012
2 answers
174 views
I was trying to recreate the custom command demo and I'm having an issue.

The issue seems to relate to the text property on the command:
command: { text: "View Details", click: showDetails }, title: " ", width: "140px"


Using the kendo.web.min.js file the following html is generated for the button.
<a class="k-button k-button-icontext k-grid-View Details" href="#">
   <span class=" "></span>
   View Details
</a>

Your demo using kendo.all.min.js:
<a class="k-button k-button-icontext k-grid-ViewDetails" href="#">
     <span class=" "></span>
     View Details
</a>

The class should be "k-grid-VIewDetails" like the "kendo.all.min.js" but in the "kendo.web.min.js" it is creating two classes one being "k-grid-View" and "Details"

This causes the button to not work.  Taking the space out of "View Details" when defining the text property for the command allows the button to work with no other modifications.
Jesse
Top achievements
Rank 1
 answered on 12 Oct 2012
2 answers
1.0K+ views
Hi,

My requirement is to show a single line of text per row in the grid. The default behavior of the grid is to show long text on multiple lines. Is there a way to show just one line of text?

Regards,
Sarvesh
Sarvesh
Top achievements
Rank 1
 answered on 12 Oct 2012
0 answers
118 views
Hi,

I am generating a bar chart having multiple series. i have generated datasource in controller and passed to view. 
chart is getting displayed with no grouping on series.

Here is view code:

@(Html.Kendo().Chart(Model.VOCBar)    
        .Name("chart6") 
        .Title("Sales") 
        .DataSource(dataSource => dataSource 
            .Group(group => group.Add(model => model.Type)) 
            .Sort(sort => sort.Add(model => model.Date).Ascending()) 
            .Read(read => read.Action("_StockData""Home"))           
        ) 
        .Series(series => 
        { 
            series.Column(model => model.Count) 
                .Name("Type") 
                .GroupNameTemplate("#= group.value #"); 
        }) 
        
.Legend(legend => legend 
            .Position(ChartLegendPosition.Bottom) 
        ) 
        .ValueAxis(axis => axis.Numeric() 
            .Labels(labels => labels 
                .Format("{0}"
                .Skip(2) 
                .Step(2) 
            ) 
        ) 
        .CategoryAxis(axis => axis 
            .Categories(model => model.Date) 
            .Labels(labels => labels.Format("MMM")) 
        )        
        .Tooltip(true)       
     ) 

Please guide me.

--
Swapnil
Swapnil
Top achievements
Rank 1
 asked on 12 Oct 2012
0 answers
80 views
Hey I was wondering is there a js event fired when the chart is rendered completely ? Not when the page appears with the axis (so no document.ready doesnt do the job) but when the actual points are rendered ?
Neil
Top achievements
Rank 1
 asked on 12 Oct 2012
1 answer
152 views
Hi all,
I have found an errors when drag and drop a node to another node in Kendo UI Treeview.
I'm using remote data method to bind the treeview.
Error: 'dataSource' is null or not an object
Error: 'this._data.length' is null or not an object
Nick Wu
Top achievements
Rank 1
 answered on 12 Oct 2012
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?