Telerik Forums
Kendo UI for jQuery Forum
1 answer
118 views
Hello
anchor button click fires twice, here is my code

1.<div data-role="view" id="drawer-company" data-layout="drawer-layout" data-title="Company">
2.    <header data-role="header">
3.        <div data-role="navbar">
4.            <a data-role="button" data-align="right" data-click="UpdateCompanyDetails_Click">Update</a>
5.        </div>
6.    </header>
7.</div>


1.function UpdateCompanyDetails_Click(e) {
2.    e.preventDefault();
3.    alert("Updated");
4.    return false;
5.}
Regards
Kiril Nikolov
Telerik team
 answered on 08 Oct 2013
1 answer
244 views
This is my template:
editTemplate: " <tr>\
                        <td class='name'>\
                                <input type='text' value='#: PageName #' class='k-textbox small' />\
                        </td>\
                        <td class='action'>\
                            <a href='\\#' class='icon icon-ok k-update-button' title='Save Changes'></a>\
                        </td>\
                        <td class='action'>\
                            <a href='\\#' class='icon icon-remove k-cancel-button' title='Cancel'></a>\
                        </td>\
                    </tr>",

When I have firebug open and I click save changes (k-update-button) I get no ajax call...my DS defines it, and the GET\DELETE work fine...any idea what it might be???

favsList.kendoListView({
            dataSource: new kendo.data.DataSource({
                transport: {
                    read: {
                        url: f.baseUrl + $medportal.User.UserName,
                        dataType: "json",
                        type: "GET"
                    },
                    update: {
                        url: f.baseUrl + "/Update",
                        dataType: "json",
                        type: "PUT"
                    },
                    destroy: {
                        url: function (data) {
                            var url = f.baseUrl + $medportal.User.UserName + "/" + data.FavouriteID;
                            return url;
                        },
                        dataType: "json",
                        type: "DELETE"
                    }
                },
                batch: false,
                pageSize: 10,
                schema: {
                    model: {
                        id: "FavouriteID",
                        fields: {
                            FavouriteID: { editable: false, nullable: true },
                            Index: { type: "number" },
                            PageName: { type: "string" },
                            Url: { type: "string" }
                        }
                    }
                }
            }),
            template: kendo.template(f.rowTemplate),
            editTemplate: kendo.template(f.editTemplate),
            remove: function (e) {
                var fav = e.model;
                if (fav.FavouriteID === f.currentfavoriteid) {
                    //Reset the Add Button
                    f.setAddState();
                }
            }
        }).data("kendoListView");
Alexander Popov
Telerik team
 answered on 08 Oct 2013
3 answers
140 views
I'm looking for a way to replace the backgrounds in a bullet chart with gradients or images such as in the attachment.
Iliana Dyankova
Telerik team
 answered on 08 Oct 2013
3 answers
168 views
I have a grid using a customer filter that is appended to the thead. On a keydown event of the customer filter field, the focus is moved to first data field of the grid. How do I prevent the focus change?

Section of code in question;
var timeout;
var filter = { logic: "and", filters: [] };
var filterRow = $('<tr><td><input type="search" id="programCodeFilter" class="k-textbox" style="width:75px;"></td><td><input type="search" id="lenderProgramNameFilter" class="k-textbox" style="width:75px;"></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>')
detailGrid.data("kendoGrid").thead.append(filterRow);
 
detailGrid.find("input#programCodeFilter").keydown(function () {
    var filterExpr = { field: "ProgramCode", operator: "startswith", value: "" }
    var fc = 0;
    if (filter.filters.length > 0) {
        for (var i = filter.filters.length - 1; i >= 0; i--) {
            if (filter.filters[i].field == 'ProgramCode') {
                var rmFilter = filter.filters[i];
                rmFilter.value = this.value;
                fc++;
            }
        }
        if (fc == 0) {
            filter.filters.push(filterExpr);
        }
    } else {
        filterExpr.value = this.value;
        filter.filters.push(filterExpr);
    }
 
    clearTimeout(timeout);
    timeout = setTimeout(function () {
        detailGrid.data("kendoGrid").dataSource.filter([filter]);
    }, 100);
});
Dimo
Telerik team
 answered on 08 Oct 2013
1 answer
86 views
Hi:

I need to know how to put the style of a cancel button when entering an event, right now it is showing as a link. I'm using MVC Razor version:

If you see the attached file, the button "Cerrar" is not showing the style that is supposed to show.

Thanks

Johnny
Kiril Nikolov
Telerik team
 answered on 08 Oct 2013
1 answer
286 views
Hi ,

I am totally new to Kendo UI . I was playing with Kendo WEB UI grid and have following code. Trying to change the column heading and for some reason its not working... I am using Json using Web API for datasource.

<!-- here is code --:
<!DOCTYPE html>

<html >
<head>
<title>Kendo UI</title>
<link href="Content/kendo/2013.2.716/kendo.common.min.css" rel="stylesheet" />
<link href="Content/kendo/2013.2.716/kendo.default.min.css" rel="stylesheet" />
<script src="Scripts/jquery-1.9.1.js"></script>
<script src="Scripts/kendo/2013.2.716/kendo.web.min.js"></script>


<script>
$(function () {

$("#employeesGrid").kendoGrid({
dataSource: new kendo.data.DataSource({

transport: {
read: "api/employees"
},
columns: [
{
field: "DOB",
title: "Date Of Birth"
},
{
field: "FirstName",
title: "First Name"
}
],
})
});
});
</script>
</head>
<body>
<div id="employeesGrid"></div>

</body>
</html>

Kiril Nikolov
Telerik team
 answered on 08 Oct 2013
4 answers
219 views
Hello,

     Let me preface this question with the fact that we are very new to List Views and Kendo UI in general. We are developing our project with MVC and using the client side (non-server side wrapper) approach to the Kendo UI List Views. We pass JSON down to the view and render the List View with no problems. We can add list items fine as well. The only issue is when we try to update/delete a record we are not properly returning JSON back to our controller server side.  I believe the issue is in our ParameterMap code:

I have tested to ensure that the JSON data in parameter map is valid for the record updated and picks up the change. 
        $(document).ready(function () {
            dataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: 'Read',
                        dataType: 'json'
                    },
                    destroy: {
                        url: 'Destroy',
                        dataType: 'json'
                    },
                    create: {
                        url: 'Create',
                        dataType: 'json'
                    },
                    update: {
                        url: 'Update',
                        dataType: 'json'
                    },
                    parameterMap: function (data, operation) {
                        if (operation == "update") {
                            return kendo.stringify(data); //what to return here?
                        } 
                    }

                },
                schema: {
                    data: 'Data',
                    model: {
                        id: 'LoanNumber',
                        fields: {
                            LoanNumber: 'LoanNumber',
                            PrimaryCifNumber: 'PrimaryCifNumber',
                            GrossLoanAmount: 'GrossLoanAmount',
                            Opit: 'Opit',
                            RefinanceAmount: 'RefinanceAmount',
                            LoanLeaseType: 'LoanLeaseType',
                            RepaymentType: 'RepaymentType',
                            LoanLeaseTermMonths: 'LoanLeaseTermMonths',
                            RepaymentFrequency: 'RepaymentFrequency',
                            PreApproval: 'PreApproval',
                            CollateralType: 'CollateralType'
                        }
                    }
                }
            });
            var listView = $("#LineofCreditsListView").kendoListView({
                selectable: true,
                navigatable: true,
                editable: true,
                dataSource: dataSource,
                template: kendo.template($("#template").html()),
                editTemplate: kendo.template($("#editTemplate").html()),
            }).data("kendoListView");

Our controller/Action Method for update  is actually reached when committing the update but nothing is in the parameter request

public void Update(JsonResult request)
        {
            //update DB
        }
My question is - what is the standard way of passing in JSON to an action method for update? We want to stay away from the server side wrapper in using Kendo UI. We basically want to just pass JSON back and forth between the client and server. If you have a sample project that we could view that demonstrates a client side approach that would be great.

Thanks,
   Justin
  
Justin
Top achievements
Rank 1
 answered on 07 Oct 2013
3 answers
983 views
Hi 

In my application I have a view that has a date type input, the view has an associated field model and is associated by binding to a model property. Code:

<div id="selectMenu" data-role="view"  data-title="Emp-Suc"  data-model="selectMenu_model">
<ul data-role="listview" data-style="inset">
                <li>
                    <label>
                        Fecha Proceso
                        <input type="date" data-bind="value: processDate"/>
                    </label>
                </li>
                <li>
                    <i></i><a data-role="button" data-bind="click:submit" style="float: right;" data-icon="details" >Continuar</a>     
                </li>
            </ul>
</div>

This is the model:

var selectMenu_model = new kendo.observable({
    company: null,
    branch: null,
    processDate: "",
    companies: function(){
        dataConfigurationHierarchical.set("method","GetCompanies");
        dataConfigurationHierarchical.set("params", { login: kendo.stringify(userModel.get("login"))});
        return dataConfigurationHierarchical.getSource();
    },
    branches: function(){
        dataConfigurationHierarchical.set("method","GetBranches");
        dataConfigurationHierarchical.set("params", { login: kendo.stringify(userModel.get("login"))});
        return dataConfigurationHierarchical.getSource();
    },
 
    submit: function(){
        var cp = $("#company").data("kendoDropDownList").value();
        var br = $("#branch").data("kendoDropDownList").value();   
        var pd = selectMenu_model.get("processDate");
        //console.log("Compañia: " + cp + "   Sucursal: " + br);
        if(cp !== '' && br !== '' && pd !== ''){
 
 
            app.navigate("views/menu.html");
        }
    },
     
 
});
The problem is when I want to get the value of the date field, I have clear that the documentation says that you get with model.get ("property") in my case would use selectMenu_model.get ("processDate") or this.get("processDate"). It is assumed that when you change the date changes the value in the model. I tried in the browser and it works fine, I can get the value, I tried it on Android 4.0 ICS and also worked well but I test in Safari iOS 5.1 and when I make the date change, the model do not change is that the value is null, as initialized. Forget the methods, that me is working well (companies, branches, submit) ..

I appreciate a response. 
Alexander Valchev
Telerik team
 answered on 07 Oct 2013
2 answers
152 views
Hello,

I would like to add a Twitter Bootstrap badge to Text off PanelBar? I tried this, but it didn't work:
01.@(Html.Kendo().PanelBar()
02.     .Name("NavigationBar")
03.     .Items(panelBar =>
04.    {
05.           panelBar.Add().Text(@LayoutResource.Actions)
06.         .Items(item =>
07.         {
08.              item.Add().Content("<a href=\"#\"><span class=\"badge pull-right\">42</span>Home</a>");
09.         });
10.    }  
11. )
12. )
I'll be grateful for help. In atachments is a screen with this what I mean.

Damian
Damian
Top achievements
Rank 1
 answered on 07 Oct 2013
1 answer
263 views
I have a simple Kendo grid with inline editing capabilities that I want to tie to a Pie chart. 
Basically, when I update the value of a certain row[column] in the grid, I want the Pie chart 
to reflect the change and redraw immediately. How can I do that?

The data for the grid is saved/added to a List<ProductViewModel> which has Name and Price properties. 
Alexander Popov
Telerik team
 answered on 07 Oct 2013
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?