Telerik Forums
Kendo UI for jQuery Forum
0 answers
65 views
my grid

$("#grid").kendoGrid({
                        change: onChange,
                        selectable: "multiple",
                       .......
                       )}

        function onChange(arg) {
            this.select().text();    // get text
                                     // and how can I get a line number in the grid on change
                          }

thanks
Igor
Top achievements
Rank 1
 asked on 07 Aug 2012
1 answer
738 views
Hi There,

I have a problem handling the click event of a anchor element inside a Kendo grid.
I have enabled the grid to be Selectable with single select option. 
I have also registered a javascript function for Change event of the kendo grid.

I have a column in the grid which has a link and on click of that link I have to open a kendo window.

The problem - OnChange event of the grid fires first and checks the checkbox in column #1 of the grid and then opens the kendo window. 

The actual behavior I am looking for is not checking the check box and only opening the kendo window.

Here is the code what it looks like in javascript.

jQuery(function(){
jQuery(
"#customerList").kendoGrid({
change:updateCusterRow,
columns:[
{title:
"\u003cinput checked=\"checked\" disabled=\"true\" id=\"chkCust\" name=\"chkCust\" type=\"checkbox\" value=\"true\" /\u003e\u003cinput name=\"chkCust\" type=\"hidden\" value=\"false\" /\u003e",attributes:style:"border:none;"},width:"35px",template:"\r\n                    #if (Selected == \u0027Y\u0027){ #\r\n                            \u003cinput type=\u0027checkbox\u0027 id=\u0027chk_#=Id#\u0027 checked /\u003e\r\n                    # } else { #\r\n                        \u003cinput type=\u0027checkbox\u0027 id=\u0027chk_#=Id#\u0027 /\u003e\r\n                    # } #",field:"Selected",sortable:false,encoded:true},
{title:
"Cust #",attributes: {style:"border:none;"},width:"70px",field:"Code",encoded:true},
{title:
"Company Name",attributes {style:"border:none;"},width:"370px",field:"CompanyName",encoded:true}, {title:"Type",attributes: {style:"border:none;"},width:"100px",field:"Type",encoded:true},
{title:
" ",attributes:{style:"border:none;"},width:"100px",template:"\u003ca style=\"text-decoration:underline\" href=\u0027javascript:op enKendoDialog(\"editCustomer\")\u0027\u003eEdit Cust\u003c/a\u003e",field:"Id",sortable:false,encoded:true},{title:" ",attributes:{style:"border:none;"},width:"100px",template:"\u003ca style=\"text-decoration:underline\" href=\u0027javascript:openKendoDialog(\"userShippingFavorites\")\u0027\u003eShipTos\u003c/a\u003e",field:"Id",sortable:false,encoded:true}],sortable:true,selectable:"Single, Row",
toolbar:{},
dataSource:{transport:{read:{url:
""}},type:"aspnetmvc-ajax",schema: {data:"Data",total:"Total",errors:"Errors",model:{id:"Id",fields:{Id: {type:"number",defaultValue:null},Code:{type:"string"},CompanyName: {type:"string"},Type:{type:"string"},Box:{type:"string"},Sheet: {type:"string"},Selected:{type:"string"},Modified: {type:"string"},DirectOrderFlag:{type:"string"},ShipTos: {type:"object"}}}}}});});

In internet explorer I could check the element which was clicked using window.event.srcElement and decide whether to check/uncheck the checkbox or open the window, but not sure how to do this in for firefox and other browser.

Thanks,
Nilesh
Alexander Valchev
Telerik team
 answered on 07 Aug 2012
1 answer
66 views
Is it possible to have a gauge with a barIndicator emanating from a given point in the range? e.g. Where a gauge has a range of -50 to 50, can the barIndicator emanate from 0 rather than the default of -50?
Hristo Germanov
Telerik team
 answered on 07 Aug 2012
4 answers
362 views
I cannot implement nested drop target. For example, I have 2 types of elements, control and container. Both of them are draggable, and container is drop target.

<div id="control">control</div>

<div id=
"base" style="width:600; height:400">
<div id="container1" style="width:200; height:100"></div>
<div id="container2" style="width:200; height:100"></div>
</div>

<script> 
$(document).ready(function() {
$("#control","#container1","#container2").kendoDraggable({
hint: function(e) { return e.clone();}
});

$(
"#base","#container1","#container2").kendoDropTarget({
drop: function(e) { this.element.append(e.draggable.currentTarget.clone()); }
});
});
</script>

Whenever I drop the control to "base" or "container1" or "container2", the drop event was only triggered by "base" only. Can I trigger the drop event in "container1" if I drop the control into it?

Thank you.


Nohinn
Top achievements
Rank 1
 answered on 07 Aug 2012
0 answers
116 views
Hi everyone...Im new in using kendoUI. When I added-in "required" in <input type = "text" required valaidationMessage = "Please fill in">, it is not working. Why is it like that? And is that any tutorial for me to refer how to validate whether the username and password that user input are correct or not? Thanks in advance.
tan
Top achievements
Rank 1
 asked on 07 Aug 2012
10 answers
1.8K+ views
Right now I am using:
$("#gridEmailAddress").kendoGrid({
.
.
toolbar: ["create", "save", "cancel"]
});

I like the current toolbar buttons, but I would like to add a custom button.

How can I add a custom button and specify what function it calls?
Vikas
Top achievements
Rank 1
 answered on 07 Aug 2012
4 answers
171 views
Hi,

I was able to delete records using below code but not the first record on the grid. Looking at the html in firebug, I found out that for the first row's delete button is directly in the div tag and missing the form tag that has the action. Although, I have provided enough width for the last column, the command buttons are stacked. (Check in the attached display screen). Thanks in advance for any help.

@(Html.Kendo().Grid(Model)       
        .Name("Grid")
        .HtmlAttributes(new { @style = "width:500px;" })
                    .Editable(editable => editable.Mode(GridEditMode.PopUp).DisplayDeleteConfirmation(true)
                        .TemplateName("Grid")
                        .Window(w => w.Title("Product")                     
                        .Name("grdWindow")
                        .Animation(true)
                        .HtmlAttributes(new { @style = "width:500px;" }).Modal(true)))
        .Columns(column =>
        {
            column.Bound(p => p.ProductID).Width(120);
            column.Bound(p => p.ProductName).Width(200);
            column.Bound(p => p.Color).Width(120);
            column.Command(command => { command.Edit(); command.Destroy(); }).Width(420);
        })
            .Pageable(pager => pager.PageSizes(true).PreviousNext(true ))           
            .Sortable()
            .Selectable()           
            .DataSource(datasource => datasource
                .Server().PageSize(5)
                .Update("EditProduct", "Home")           
                .Destroy("DeleteProduct", "Home")               
                .Model(model => model.Id(p => p.ProductID))
            )
            )
Ratna
Top achievements
Rank 1
 answered on 07 Aug 2012
0 answers
96 views
I put together a sample in jsfiddle to better illustrate this issue. I have a kendo tabstrip with a content div element that has a fixed height and auto scrolling if content exceeds the specified height.

http://jsfiddle.net/BjtHc/1/

The problem is specific to IE7 (maybe IE6 - haven't tested)
If I do not style the elements with 'k-textbox', the tab strip scrolling behaves well. If I style the text box elements with 'k-textbox' (or any other kendo input style), they remain stationary. 
This example works perfectly in Chrome/Firefox/Safari. 

How do I fix this for IE7?
Thanks in advance.
Ashwin
Top achievements
Rank 1
 asked on 07 Aug 2012
0 answers
119 views
hi.

Kindly can anyone suggest how to do paging when the grid binded with webmethod data. how to pass the parameter skip and take values to the web method or can anyone suggest how to get skip and page parameter and send back to webmethods
satheesh
Top achievements
Rank 1
 asked on 07 Aug 2012
2 answers
243 views
Hi,

I have two treeviews in one page, and upon selecting a node in treeview #1, I'm loading a new datasource in treeview #2 (depending on the selected node in #1, but that's a detail I'm omitting here).

This works fine the first time you select a node in #1. Treeview #2 displays the new data. In fact, it even works on subsequent selections, but an error occurs in #1: "Cannot read property 'uid' of undefined". Treeview #2 still shows the new data, but treeview #1 doesn't get round to highlighting the selected node, because of the error. I have no idea why this is happening.

The following example should show this error. This example code is based off of the standard Kendo demo for using a Hierarchical DataSource. My variation uses a new instance of the same datasource for both treeviews, which makes the example look rather useless, but hopefully it helps to make the point.

I tried the same thing with fixed data, i.e. a datasource that uses fixed, inline data, and that does seem to work.

<div id="treeview"></div>
 
<div id="treeview2"></div>
 
<script>
 
    function MakeTreeview(parent, child) {
        var serviceRoot = "http://demos.kendoui.com/service";
        homogeneous = new kendo.data.HierarchicalDataSource({
            transport: {
                read: {
                    url: serviceRoot + "/Employees",
                    dataType: "jsonp"
                }
            },
            schema: {
                model: {
                    id: "EmployeeId",
                    hasChildren: "HasEmployees"
                }
            }
        });
 
 
        $(parent).kendoTreeView({
            dataSource: homogeneous,
            dataTextField: "FullName",
            select: child != null ? function (e) {
                MakeTreeview(child, null);
            } : null
 
        });
 
    }
 
    MakeTreeview("#treeview", "#treeview2");
</script>


Any suggestions are greatly appreciated, thanks.
Jean-Pascal van der Endt
Top achievements
Rank 1
 answered on 07 Aug 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?