Telerik Forums
Kendo UI for jQuery Forum
2 answers
175 views
Hi,
How do I validate the autocomplete text-box has valid value form remote data and user has not typed anything in it using custom validator.
Kuldeep
Top achievements
Rank 1
 answered on 11 May 2012
2 answers
111 views

I am experiencing a strange issue with the alignment of my chart.  My development chart shows up as expected, however when I deploy to my test server it throws it off.   See attached screenshots.   Any ideas would be greatly appreciated.

Alex R.
Top achievements
Rank 1
 answered on 11 May 2012
2 answers
179 views
Question:

I have a simple mobile app that consists of four tabStrip items which, in their respective views, contain scollable lists.  I can't wrap my head around navigating from a list-view item link to a content page.  The problem is when I click the link nothing happens --no transitions, zilch.  Here's my code:

// Sample TabStrip View containing a slightly modified list item link to a div
<div data-role="view" id="tabstrip-generes" data-title="Generes" data-layout="mobile-tabstrip">
<ul data-role="listview">
<li>
<a class='km-listview-link' src='#filmA'>Film A</a>
</li>
</ul>
</div>

// Desired view to navigate to
<div data-role="view" id="filmA">
Film Details, etc.  Basic content page; this single view will be repopulated with content depending upon what list-item link item is clicked then shown.
</div>

// Bottom Tab Strip
<div data-role="layout" data-id="mobile-tabstrip">
    <header data-role="header">
        <div data-role="navbar">
            <span data-role="view-title"></span>
            <a data-align="right" data-role="button" class="nav-button" href="#index">Index</a>
        </div>
    </header>

    <div data-role="footer">
        <div data-role="tabstrip">
            <a href="#tabstrip-home" data-icon="contacts">Home</a>
            <a href="#tabstrip-generes" data-icon="history">Generes</a>
            <a href="#tabstrip-search" data-icon="favorites">Search</a>
            <a href="#tabstrip-news" data-icon="settings">News</a>
        </div>
    </div>
</div>

Any help would be appreciated.

-Chris
Christopher
Top achievements
Rank 1
 answered on 11 May 2012
3 answers
213 views
I have a problem with a dataSource for a kendo grid. The dataSource consumes JSON endpoints for CRUD operations on a remote DB.

The JSON endpoints that the dataSource is consuming contain different root elements for read versus the other methods. The root element for a read is "GetFooResult.RootResults". The root element for all other methods is "SubmitChangesResult". The endpoints are created by the .NET DomainServices JSON endpoint factory, so I don't necessarily have influence over what format they return.

The problem is that the dataSource is not able to parse the returned JSON for methods except read, since that is what the dataSource:schema:data element is based on. Therefore when I execute a create operation it does not recognize the returned JSON; each subsequent create continues to attempt to send all previous create attempts, which creates duplicate records in the DB.

Any idea how to specify different dataSource:schema:data elements for the various transport methods? There seems to be only one schema with one data element per datasource. Could I write code under parameterMap that sets this element depending on the transport method?

Thanks,
David
David
Top achievements
Rank 1
 answered on 11 May 2012
2 answers
255 views
Hi
I'm trying to use mvvm and templates to produce a grid with column totals. A fairly simple scenario I think. I can get the grid to render and the column footer to show. However, I no longer have the ability to edit the grid cells (due to the row template that I am using). What can I do to make the rows function as if I was not using the template, and binding the products list to the table instead. Or can I just bind to the table and somehow have a custom footer that I can use to bind to my view-model with calculated totals. BTW I can just use a datasource and "sum" aggregate as I want to do some "math" to produce the total.
I have a jsfiddle of the scenario.
http://jsfiddle.net/darrenarbell/K9tnS/26/

Thanks in advance

Regards

 
Iliana Dyankova
Telerik team
 answered on 11 May 2012
4 answers
174 views
I'm trying to call an MVC controller action to populate my grid and I need to pass a parameter to it. However, my breakpoint in the action isn't getting hit. Am I doing something wrong here? I can't tell if my param is making it through since my breakpoint isn't getting hit. Do I need to set up a route for this call?

Action:

[HttpGet]
public JsonResult GetSalesHistory(string id)
{
    List<Sales> sales = PestsLogic.GetSalesById(5);
    return Json(new { data = sales, total = sales.Count }, JsonRequestBehavior.AllowGet);
}

JavaScript code:

<script type="text/javascript">
    $("#grid").kendoGrid({
        dataSource: {
            type: "json",
            transport: {
                read: {
                    url: "Sales/GetSalesHistory",
                    dataType: "json",
                    type: "GET",
                    contentType: "application/json; charset=1-8",
                    data: { id: "@ViewBag.CustomerEstimateKey" }
                }
            },
            pageSize: 15,
            schema: {
                data: "data",
                total: "total"
            }
        },
        pageable: true,
        sortable: true
    });
</script>
Jay
Top achievements
Rank 1
 answered on 11 May 2012
1 answer
876 views
Hi,

Can you please provide the way to correct edit date type column in grid
I have following parts
 defined model
var Model = kendo.data.Model.define({
                id: "Id",
                fields: {
                    SDate: { nullable: true, type: "date" } }});
and define column in grid

{
                field: "SDate",
                title: "Date",
                type: "date",
                template: "#= (SDate== null) ? ' ' : kendo.toString(toDate(SDate), 'MM/dd/yyyy') #"
            }
When records come from json result template for this column shows date correctly but once I click into cell to edit date picker has \Date(123123123123) value as input. It seems like datepicker doesn't parse json date format to edit.
Any ideas on this?

Phillip
Top achievements
Rank 2
 answered on 11 May 2012
1 answer
137 views
I have a grid with a popup edit window. The edit window comes up without problem. When I edit I get the popup window with the appropriate fields. When I click update after editing the description the javascript fails with the following code highlighted:

return isFinite(b.valueOf())?b.getUTCFullYear()+"-"+pad(b.getUTCMonth()+1)+"-"+pad(b.getUTCDate())+"T"+pad(b.getUTCHours())+":"+pad(b.getUTCMinutes())+":"+pad(b.getUTCSeconds())+"Z":null}

Anyone have any thoughts on why this is happening?

Page code is as follows:

@model HopitelNetworksPlatform.Models.FacilityProblem
 
@{
    ViewBag.Title = "ProblemTracking";
}
 
 
<h2>Problem Tracking<br />
Facility: @Model.FacilityName
</h2>
 
<p>
    @Html.ActionLink("Add Problem", "CreateProblem", new { facilityID = Model.FacilityID } )
</p>
 
<div id="test"></div>
<div id="problemGrid"></div>
 
<script type="text/javascript">
 
    var gridLoaded = false;
 
    var categoryData = new kendo.data.DataSource({
         
        schema: {
            model: {
                id: "ProblemCategoryID",
                fields: {
                    ProblemCategoryID: { type: "int" },
                    ProblemCategoryName: { type: "string" }
                }
            }
        },
        transport: {
            read: {
                url: "@Url.Action("ProblemCategoryList", "Diagnostic")",
                type: "POST"
            }
        }
    });
    categoryData.read();
 
    var bedData = new kendo.data.DataSource({
         
        schema: {
            model: {
                id: "RoomBedID",
                fields: {
                    RoomBedID: { type: "int" },
                    RoomBedName: { type: "string" }
                }
            }
        },
        transport: {
            read: {
                url: "@Url.Action("RoomBedList", "Facility", new { facilityID = Model.FacilityID })",
                type: "POST"
            }
        },
        change: function(e) {
            if(gridLoaded == false) {
                DisplayGrid();
                gridLoaded = true;
            }
        }
    });
    bedData.read();
 
    function lookupCategoryName(ProblemCategoryID)
    {
        if(ProblemCategoryID == undefined) {
            return "";
        }
        else {
            var problemCategory = categoryData.get(ProblemCategoryID);
            return problemCategory.ProblemCategoryName;
        }
    }
      
    function lookupBedName(RoomBedID)
    {
        if(bedData.total() == 0)
        {
            return RoomBedID.toString();    //(todo)(change to unknown or something)
        }
        else
        {
            if(RoomBedID == undefined) {
                return "";
            }
            else {
                var roomBed = bedData.get(RoomBedID);
                return roomBed.RoomBedName;
            }
        }
    }
    
 
function DisplayGrid() {
 
    $("#problemGrid").kendoGrid({
        pageable: true,
        columns: [
            { field: "RoomBedID", title: "Location", width: "5%",
                editor: function(container,options) {
                    $('<input name="' + options.field + '"/>').appendTo(container).kendoDropDownList({
                        dataSource: bedData,
                        dataValueField: "RoomBedID",
                        dataTextField: "RoomBedName",
                        autobind: false
                     });
                 },
                 template: "#= lookupBedName(RoomBedID) #"              
            },
            { field: "DateReported", title: "Date Reported"  },
            { field: "ProblemCategoryID", title: "Problem Type",
                editor: function(container,options) {
                    $('<input name="' + options.field + '"/>').appendTo(container).kendoDropDownList({
                        dataSource: categoryData,
                        dataValueField: "ProblemCategoryID",
                        dataTextField: "ProblemCategoryName",
                        autobind: false
                     });
                 },
                 template: "#= lookupCategoryName(ProblemCategoryID)  #"
            },
            { field: "ProblemDescription", title: "Problem Description" , width: "30%" },
            { field: "DateResolved", title: "Date Resolved" },
            { field: "ResolutionDescription", title: "Resolution", width: "30%" },
            { command: "edit", title: "Edit", width: "110px" }
        ],
        editable: "popup",
        toolbar: ["create", "save", "cancel"],
        dataSource: {
            schema: {
                model: {
                    id: "ProblemID",
                    fields: {
                            ProblemID: { type: "int", editable: false, nullable: true },
                            RoomBedID: { type: "int", nullable: true },
                            RoomBedName: { type: "string" },
                            DateReported: { type: "date", editable: false },
                            ProblemCategoryID: { type: "int", nullable: true },
                            ProblemCategory: { type: "string" },
                            ProblemDescription: { type: "string" },
                            DateResolved: { type: "date", nullable: true, editable: false },
                            ResolutionDescription: { type: "string", nullable: true }
                    }
                }
            },
            batch: true,
            pageSize: 10,
            transport: {
                create: {
                    url: "@Url.Action("CreateProblem2", "Diagnostic")",
                    type: "POST"
                },
                read: {
                    url: "@Url.Action("ProblemList", "Diagnostic", new { facilityID = Model.FacilityID })",
                    type: "POST"
                },
                update: {
                    url:"@Url.Action("UpdateProblem", "Diagnostic")",
                    type: "POST"
                },
                destroy: {
                    url: "@Url.Action("DestroyProblem", "Diagnostic")",
                    type: "POST"
                }
            }
        }
    });
}
 
 
</script>


Alexander Valchev
Telerik team
 answered on 11 May 2012
1 answer
100 views
Hi,

Is it possible to creating own url query string to web service in DataSource and how to do that?

Instead of making request with url generated from DataSource like /data/GetAll?take=5&skip=5...
I want to create request with url in RESTful convention like data/GetAll/take/5/skip/5...
Alexander Valchev
Telerik team
 answered on 11 May 2012
3 answers
671 views
Hi,
I want to move the data that are checked in the grid to another grid when i clicked the button and if it is check all all then i have to move all the data from one gird to another and empty the other grid please find the screen shots below

Very urgent

Thanks in advance.

Ricardo
Top achievements
Rank 1
 answered on 11 May 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
Form
MaskedTextBox
View
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
ArcGauge
AICodingAssistant
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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?