Telerik Forums
Kendo UI for jQuery Forum
2 answers
1.0K+ views
I create a Grid using kendoGrid :), here is the code for getting the selected row's data

var tr = $("#productGrid").find("tbody tr.k-state-selected");
var product = $("#productGrid").data("kendoGrid").dataItem(tr);
for(var o in product){
    if(product.hasOwnProperty(o)){
        //do something with o ..
        //Here i found o has properties like: _events,uid
        /*
        product
          o.extend.init
            _events: Object
            test0: o.extend.init
            test1: o.extend.init[2]
            test2: "string"
            test3: "string"
            uid: "b5494c4b-c89d-4139-885d-b376933f17bd"
            __proto__: y.extend.b
        */
        //It may have trouble when i want to do something with o
    }
}

so, what should i do to get the pure product object without the properties: _events , uid..


since my native language is not English, please forgive my grammar errors :)
Chris
Top achievements
Rank 1
 answered on 12 Apr 2012
4 answers
124 views
Greetings.

My company's flagship product is currently built on jQuery and KendoUI, with all our plugins using the standard jQuery style. I am in the process of converting them to use the KendoUI plugin style outlined in the recent blog posts, so we can take advantage of the new MVVM features. That said, the blog posts showing how to write KendoUI plugins leave out how to do the following:

  1. Events: I assume we are supposed to use the "widgetData.bind('event', handler)" style for externally facing events. I just want to know how I should bind and trigger my custom events for my plugins? Also, for internal events should I keep using the jQuery style  "scopeSelector.on('event', 'elementSelector', handler"?
  2. Declaractive style & Data Sources: What does my plugin need in order to hook up to data-sources and references provided by "source" and "value" tags from the new declarative style of plugin initialization? 
Thanks for any help you can provide.
Joshua
Top achievements
Rank 1
 answered on 12 Apr 2012
9 answers
106 views
I am not sure how to approach this particular case.   I have a json dataset coming back from a web service and it returns the following data:
"WFP_MacroDemandForecastResponse": {
    "Results": {
        "@ViewName": "WFP_MacroDemandForecast",
        "RowSet": {
            "@ColDims": "Workforce Planning Value",
            "Rows": [
                {
                    "WorkforcePlanningMeasure": {
                        "@Name": "HC Demand",
                        "@DimName": "Workforce Planning Measure",
                        "@ID": "Headcount Demand",
                        "#text": "HC Demand"
                    },
                    "Value": "0",
                    "ChangeRate": "0",
                    "BaseYear": "0",
                    "ForecastDriver": "0",
                    "_5YearGoal": "0",
                    "Year1": "0",
                    "Year2": "0",
                    "Year3": "0",
                    "Year4": "0",
                    "Year5": "0"
                },
 {...rows node repeats...}

In order to make the grid editable, I have to supply a model and an ID, but not sure how to specify this when the data source has the ID in an child attribute element.

Here is the code:
this.Data = new kendo.data.DataSource({
    transport: {
        read: {
            dataType: "json"
        }
    },
    batch: true,
    schema: {
        data: "WFP_MacroDemandForecastResponse.Results.RowSet.Rows",
        model: {
            id: "WorkforcePlanningMeasure",
            fields: {
                WorkforcePlanningMeasure: { editable: false },   // ???????
                ChangeRate: { editable: true },
                BaseYear: { editable: true },
                _5YearGoal: { editable: true },
                Year1: { editable: true },
                Year2: { editable: true },
                Year3: { editable: true },
                Year4: { editable: true },
                Year5: { editable: true }
            }
        }
 
    }
});
 
$('#wfp_DemandMacroProjection').kendoGrid({
    dataSource: this.Data,
    sortable: true,
    pageable: true,
    rowTemplate: kendo.template($("#row-template").html()),
    columns: [
        { field: "WorkforcePlanningMeasure[\"@Name\"]", title: "Metric", width: 200 },
        { field: "ChangeRate", title: "Change Rate", width: 30 },
        { field: "BaseYear", title: "Base Year", width: 30 },
        { field: "_5YearGoal", title: "Goal", width: 30 },
        { field: "Year1", title: "Year 1", width: 30 },
        { field: "Year2", title: "Year 2", width: 30 },
        { field: "Year3", title: "Year 3", width: 30 },
        { field: "Year4", title: "Year 4", width: 30 },
        { field: "Year5", title: "Year 5", width: 30 }
    ],
    editable: true
});





Steven
Top achievements
Rank 1
 answered on 12 Apr 2012
2 answers
240 views
sir/madam,

I want copy or duplicate record in kendo ui grid, how is it possible this option, could u help me please, next  i need custom edit delete option and add new record or row come with (edit, delete) same columns,

i am expecting your reply

Thanks & Regards,
C.Vadivel
Ricardo
Top achievements
Rank 1
 answered on 12 Apr 2012
0 answers
115 views
Hi There,

Is there a way to set the onlabel and offlabel values as attributes on the input tag or does this have to be done using javascript?

As an aside is it possible to disable a switch as well?

Thanks!

Rob
Robert
Top achievements
Rank 1
 asked on 12 Apr 2012
1 answer
87 views
Hi Guys,
When I am adding page scroll view functionality in splitter for mobile apps then its not working.

when I am adding <script src="js/kendo.mobile.min.js" type="text/javascript"></script> then scrolling is working.

But when i am removing this from html file then splitter is working and scrolling doesn't work.

attaching html file.

Please help me in resolving this.
Petyo
Telerik team
 answered on 12 Apr 2012
1 answer
216 views
The following does not work.  Is it possible to use a template and still format some values?
template: "${category} - ${value:N2}" 
Alexander Valchev
Telerik team
 answered on 12 Apr 2012
3 answers
2.3K+ views
How to refresh a grid with parameters, I write that, but it's not work,pls help me ,thanks.
                     grid_ .dataSource.read({
                          url: "charge-property/resources/unit_list_data.jsp",
                          dataType: "json",
                         data: {
                             q: "test"
                         }
                      });
                     grid_.refresh();
Petur Subev
Telerik team
 answered on 12 Apr 2012
1 answer
406 views
Hi,

Is there any way to disable/enable particular item(s) in the dropdown list?

Regards,
Khushali
Dimo
Telerik team
 answered on 12 Apr 2012
1 answer
195 views
Hi, how can I replace icon in the invalid message with my own icon?
Kjell
Top achievements
Rank 1
 answered on 12 Apr 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
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?