Telerik Forums
Kendo UI for jQuery Forum
2 answers
262 views
Hi everyone!
First i congratulate the team of Kendo UI for this tool so good for web developers, well let's get

I have a problem with a Grid with inline editing option enabled, the problem is that the button for add a new row doesn't work and i don't know what is the way for add,edit and delete rows, also i want to know what the variable that receives php from grid.

thanks in advanced

This is  the code

 
$(function() {
kendo.culture("es-ES");
var grid = $("#grid").kendoGrid({dataSource: {transport: {read: "datos_grid.php",create: {url: "datos_grid.php",type: "POST"},parameterMap: function(options, operation) {
if (operation !== "read" && options.models) {
return {models: kendo.stringify(options.models)}
}
}},schema: {data: "data",total: function(result) {
var data = this.data(result);
return data ? data.length : 0
},model: {id: "id",fields: {id: {validation: {required: true}},user_id: {validation: {required: true}},purchase_date: {validation: {required: true},type: "date"}}}},pageSize: 5,autoSync: true,batch: true},columns: [{title: "ID",field: "id",type: "text"}, {title: "Id Usuario",field: "user_id",type: "text"}, {title: "Fecha",field: "purchase_date",format: "{0:dd/MM/yyyy}"}, {command: ["edit", "destroy"],title: " ",width: "210px"}],pageable: {refresh: true,pageSizes: 5},toolbar: ["create", {template: kendo.template($("#template").html())}],editable: "inline"});
$("#category").keyup(function() {
var value = $(this).val();
if (value) {
grid.data("kendoGrid").dataSource.filter({logic: "or",filters: [{field: "id",operator: "contains",value: value}, {field: "user_id",operator: "contains",value: value}]})
} else {
grid.data("kendoGrid").dataSource.filter({})
}
})
});

kevin
Top achievements
Rank 1
 answered on 27 Aug 2012
1 answer
204 views
We have a custom filtering controls in the column header of the Grid, now when we try to enable sorting then the sort icon appears in a odd location; I would like the sort icon to appear right after the label. Any suggestions on how to achieve that attached is the snapshot of how it looks and below is the markup we have for columns.

<table class='list-entity'>
    <thead>
        <tr>
            <th data-field='Actions' style='width:48px'>&nbsp;</th>
            <th class='filter' data-field='Code' style='width:250px'>
                <label>ID</label>
                <input class='grid-filter' data-field='Code' />
            </th>
            <th class='filter' data-field='Description'>
                <label>Description</label>
                <input class='grid-filter' data-field='Description' />
            </th>
        </tr>
    </thead>
</table>
Navnit
Top achievements
Rank 1
 answered on 27 Aug 2012
1 answer
104 views
I have a grid with a data source that posts JSON to my server and returns JSON to populate the grid. What I need to do is add the capability to download the data as an Excel file. The creation of the Excel file is easy enough, but what I need help with is forming a proper URL, using a datasource's existing filtering and sorting options as query parameters. The reason for this is that file downloads via ajax posting are not allowed.

Obviously the framework does this internally when setting a data source transport's type to GET. Is there a way I can access the transport's read URL? My export URL will be identical, with a minor change I can make manually. If there is no way to get the full URL, is there a way to have the data source's filter and sort values be URL encoded by the framework?

If these aren't possible, might I suggest adding an "export" transport option to the data source object that we could configure for just this scenario?

Thanks
Petur Subev
Telerik team
 answered on 27 Aug 2012
0 answers
148 views
i created the listview but its not displaying radio button in safari browser, firefox is displaying correctly

this code we are using
<div data-role="modalview" style="width: 100%;" id="rcm-placement-nr-list" data-layout="checklayout">
            <ul id="menuList" data-role="listview" data-template="placementNRTemplate" data-click="placementNRSelected"
                data-source="placementNRDataSource"  data-style="inset">
            </ul>
        </div>

 var schema = { model: {} };

        var placementNRDataSource = kendo.data.DataSource.create({
            data: [
                        { text: "Select a Value", value: "-1" },
                        { text: "test 1 required", value: "1" },
                        { text: "test 2 Encounter", value: "2" },
                        { text: "test 3 only", value: "3"}],
            schema: schema

        });

can you please tell us how to fix this problem

Bini
Top achievements
Rank 1
 asked on 27 Aug 2012
0 answers
334 views
Hey guys,

I have a grid bound to a DataSource which references local data.  The data is loaded with a prior ajax call and is simply re-used in this DataSource to save on a round trip to the server.  The local data is a subset of a larger data set.

I have a need to perform CRUD operations on this local data via a grid.  Prior to sending the payload to the server, I need to map the model to a server-friendly object graph.  I assume the best way to do this is via the transport.parameterMap option.

Here's my grid & DataSource configuration:

grid.kendoGrid({
    dataSource: {
        transport: {
            read: function(options) {
                options.success(filters); // filters is the local array of data
            },
            create: function(options) {
                prime.dsCrud({ url: 'CreateFilters', crud: options });
            },
            update: function (options) {
                prime.dsCrud({ url: 'UpdateFilters', crud: options });
            },
            destroy: function(options) {
                prime.dsCrud({ url: 'DestroyFilters', crud: options });
            },
            parameterMap: function(options, operation) {
                console.log(operation); // *** never fires! ***
            }
        },
        batch: true,
        pageSize: 10,
        schema: {
            model: {
                id: 'id',
                fields: {
                    id: { editable: false, nullable: true },
                    member: { type: 'string', validation: { required: true } },
                    operator: { type: 'number', validation: { required: true } },
                    dataType: { type: 'string', validation: { required: true } },
                    value: { type: 'string', validation: { required: true } }
                }
            }
        }
    },
    sortable: true,
    pageable: true,
    filterable: false,
    editable: true,
    navigatable: true,
    toolbar: ["create", "save", "cancel"],
    columns: [
        {
            field: 'member',
            title: 'Column'
        },
        {
            field: 'operator',
            title: 'Operator'
        },
        {
            field: 'value',
            title: 'Value(s)'
        },
        {
            command: 'destroy',
            title: '',
            width: '170px'
        }
    ]
});

For completeness sake, here is my prime.dsCrud function:

prime.dsCrud = function (options) {
    $.ajax({
        url: prime.data.queryTool + options.url,
        dataType: 'jsonp',
        contentType: 'application/json',
        type: 'POST',
        data: options.crud.data,
        success: function(data, textStatus, jqXHR) {
            options.crud.success(data);
        },
        error: function(jqXHR, textStatus, errorThrown) {
            options.crud.error(jqXHR);
        },
        complete: function(jqXHR, textStatus) {
            console.log('-----------------------------------');
            console.log('response from ' + options.url + ':');
            console.log(jqXHR);
            console.log('-----------------------------------');
        }
    });
}

I realize I could probably do this in the prime.dsCrud function's "data" configuration, but I would prefer to leave this function more generic.  Can anyone explain to me why my transport.parameterMap isn't firing?

Thanks!
Darren
Top achievements
Rank 1
 asked on 27 Aug 2012
4 answers
329 views
Hi, we have a subclass of TabStrip and would like to set its default animation property to false.  It seemed logical to simply override the options object with that setting -- but this causes an error as soon as you try to change tabs:

http://jsfiddle.net/nwVtr/

The error is because the TabStrip widget initializes the animation properties from the options parameter in the constructor before it has merged them with the default options of the widget.  This happens on line 33128 of kendo.web.js (v2012.2.710).

that._animations(options);

In _animations() there is a check for animations:false, where it creates an empty animations object that simply does a show/hide.  But since the widget is using the empty options parameters without merging them with the widget's default options, there is no animations:false and this default "no animations" object never gets created.

So then, when the tab is clicked, in activateTab() the 'effects' property of the animation object is accessed, which causes the error because the default "false" animation object never got created (line 33979):

if (kendo.size(animation.effects)) {

It would seem to me that the options parameter should be merged with the default options before _animations() is called, so that the animations object gets set up properly.  Is this a Kendo bug, or am I approaching this the wrong way?  Thanks!

ryan

p.s. Note the commented section of my JSFiddle; this workaround solves the issue but is definitely not as clean as simply overriding the option, as we are attempting to do.  Alternatively, I could initialize the widget's default animation property to the object that gets set inside _animations(), but that is not ideal either because it depends on undocumented internals and not the published widget API.

Ryan
Top achievements
Rank 1
 answered on 27 Aug 2012
0 answers
134 views
Hi, I use Binding OData service to binding data from this example http://demos.kendoui.com/web/treeview/odata-binding.html 

I want to know How to Expand all node 

Thankyou



Nanthaphol
Top achievements
Rank 1
 asked on 27 Aug 2012
9 answers
217 views
I noticed that some android devices have issues with properly displaying a text box (an input element). The text appears invisible as you type because the text appears black over the black background. The device I am able to reproduce this on is the Google Nexus 7, using the forms demo on the Kendo UI site.

Is there a workaround that will guarantee that the text is a visible colour on all platforms? For example, white in android and black in iOS. 

Thanks in advance,
John
Berin
Top achievements
Rank 1
 answered on 27 Aug 2012
1 answer
165 views
Hi all,

Ok I have put a problem that many people read but nobody answered. So i guess it would be usefull to make a clearer explaination:

I have a very basic kendo grid bind to odata dataservice:
-----------------------------------------------------------------------

var

myDS = new kendo.data.DataSource({
type: "odata",
transport: {
//read: { url: "/Ajax/Lists/PassagesReports/LightService.svc/PRs/"
read: { url: "/testprs.js" //I put example here of JSON return by Odata so u can test
}},
schema: {
model: {
id:
"SeqId",
fields: prLight}},
pageSize: 10,
serverPaging:
true,
serverFiltering:
true,
serverSorting:
true,
sort: { field:
"SeqId" }
});

//I load it with:
//---------------
$(document).ready(

function () {
$(
"#gridPRs").kendoGrid({
dataSource: myDS,
height:
"auto",
scrollable:
false,
filterable:
true,
columns: [ { title: "Seq.", field: "SeqId", width: "65px", template: "<div class='dprcolpad'>#= SeqId #</div>" },{ title: "Lane", field: "LineId", width: "165px", template: "<div class='dprcolpad'>#= GetLine(LineId) #</div>" },{ title: "Description", width: "230px", field: "Description", template: "<div class='dprcolpad'>#= Description #</div>" }
],
sortable: {
mode: "single",
allowUnsort:
false
},
pageable:
true});

 //Here i defined button add click
//----------------------------------
$("#btadd").click(function () {
prLight.SeqId = "11";
prLight.LineId = 20;
prLight.Description = "London";
myDS.add(prLight);

});
});

//I defined my object :
-----------------------
var prLight = {
SeqId: { type: "string", filterable: false },
LineId: { type:
"number" },
Description: { type: "string" }};

//and finaly and example of odata that u can put in js file testprs.js to make all work:
----------------------------------------------------------------------------------------
 callback({"d" : {"results": [{"SeqId": "1", "LineId": 0, "Description": "London"}, {"SeqId": "5", "LineId": 1, "Description": "Mexico"}], "__count": "2"}})

Ok so far so good. so what the problem then? well if you click add button you get a very strange error :

 "d.d is undefined" from kendo.core.js.

if you change data type from odata to json. it works well. (But i want to use dataservice and odata in this case.

Any one can help?

Thanks
Laurent


T.
Top achievements
Rank 1
 answered on 27 Aug 2012
1 answer
175 views
I need to get the row identity value of the newly created record so that I can tie it to other data. How can I extract the results in the change event?

For example...

var dsEmployee = new kendo.data.DataSource({
 type: "odata",
 transport: {
  read: {
   url: baseUrl + "/DataService.svc/Employees",
   dataType: "json"
  },
  create: {
   url: baseUrl + "/DataService.svc/Employees",
   type: "POST",
   dataType: "json"
  },
  update: {
   url:  function (o) {
    return baseUrl + "/DataService.svc/Employees(" + o.EmployeeId + ")"
   },type: "PUT",
   dataType: "json"
  }
 },
 schema: {
  model: Employee
 },change: function (e) {
  ...
 
 }
}
Rosen
Telerik team
 answered on 27 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?