Telerik Forums
Kendo UI for jQuery Forum
0 answers
78 views
Hi i have a question is posible add style to columns in grid?
Ricardo
Top achievements
Rank 1
 asked on 07 May 2012
8 answers
379 views
I have a fairly complex MVVM configuration that looks like the following:

ViewModel
    Groups
       Sections
           Rows

So, my view model contains groups, which contain sections, which contain rows. MVVM and data-templating is perfect for this type of scenario, but I'm hitting a few stumbling blocks trying to use Kendo's MVVM implementation.

Specifically, when I render a Row, I need to include a button to delete that row. Templating this is simple enough to do and I bind the click event handler to a removeRow function.

This is where I have two questions:

1) Can the removeRow function exist on my Section model instead of the root view model? I've tried to do this and it doesn't seem to work.

2) If removeRow must be on the root view model, is there a method of determining which Section the row existed in? Right now, at the root view model, I'd have to search through all groups, and then all sections, and then all rows to find out which array contains the row specified by e.data. Can I provide an additional parameter to be passed to my removeRow event handler that specifies the containing section?

Thanks

Brian Vallelunga
Top achievements
Rank 1
 answered on 07 May 2012
1 answer
74 views
I am having trouble trying to get value from the following sample json

[{"released":"2007-06-29","posters":[{"image":{"type":"poster","size":"thumb","height":118,"width":92,"url":"http://cf2.imgobject.com/t/p/w92/gMg48r3zMz6HMez4ksNEeOcrVV1.jpg","id":"4ea680f32c058837cb00c499"}},{"image":{"type":"poster","size":"w154","height":197,"width":154,"url":"http://cf2.imgobject.com/t/p/w154/gMg48r3zMz6HMez4ksNEeOcrVV1.jpg","id":"4ea680f32c058837cb00c499"}},{"image":{"type":"poster","size":"cover","height":237,"width":185,"url":"http://cf2.imgobject.com/t/p/w185/gMg48r3zMz6HMez4ksNEeOcrVV1.jpg","id":"4ea680f32c058837cb00c499"}},{"image":{"type":"poster","size":"w342","height":439,"width":342,"url":"http://cf2.imgobject.com/t/p/w342/gMg48r3zMz6HMez4ksNEeOcrVV1.jpg","id":"4ea680f32c058837cb00c499"}},{"image":{"type":"poster","size":"mid","height":641,"width":500,"url":"http://cf2.imgobject.com/t/p/w500/gMg48r3zMz6HMez4ksNEeOcrVV1.jpg","id":"4ea680f32c058837cb00c499"}},{"image":{"type":"poster","size":"original","height":854,"width":666,"url":"http://cf2.imgobject.com/t/p/original/gMg48r3zMz6HMez4ksNEeOcrVV1.jpg","id":"4ea680f32c058837cb00c499"}}],"backdrops":[],"version":225,"last_modified_at":"2012-04-30 18:27:15 UTC"}]


How can I get the value of the "url" under "posters".  I thought this would work "posters[0].image.url" but it does not work....desperate for an answer.  Trying to meet contest deadline.
Duncan
Top achievements
Rank 1
 answered on 07 May 2012
0 answers
70 views
hello
is possible with some method that a grid is not editable is editable?
Thanks in advance.
Greetings!
Ricardo
Top achievements
Rank 1
 asked on 07 May 2012
11 answers
147 views
I am using the MVVM and Datasource frameworks with the Kendo UI controls, so the control is bound via MVVM to a shared datasource. This works well with all controls when updating values. It even works fine when completely deleting values of text-like controls. The issue is with numeric or date controls, where empty string is a violation, thus NULL is used.

So for DatePicker and NumericTextBox, when a value is already present, selecting the text in the control thru the UI and deleting it, does not update the underlying datasource. Thru inspection and walking code, I can see that the controls do indeed have their value set to NULL, so it appears to be in the observer and not the controls.

Anyone else unable to delete values successfully or is this just me??

Thanks!
Mike
Rosen
Telerik team
 answered on 07 May 2012
1 answer
336 views
Hi all

i have a grid (php/json datasource) and inline editing.

i need to validate the email address field but i have a problem.

if i define the field like this in my datasource.schema.model.fields :
EmailAddress:         { validation: { required: true}, type: "email" },
then validation works perfectly when editing existing entry.
but adding throws an error. (i dont think 'email' is a valid 'type')

i think i'll need to define the field like this:
EmailAddress:         { validation: { required: true}, type: "string" },
and validate the entry with a regex. but i cant figure out how.

i though i could add a 'format' to the above 'validation' tag but that doesnt work....

does anyone have experience with this please? i've very stuck.

thanks,
Vauneen



Sarvesh
Top achievements
Rank 1
 answered on 07 May 2012
1 answer
232 views
Hi , I am totally new user of kendo but i cant even bind the data yet please give me some solutions :

<!DOCTYPE html>
<html>
<head>
    <script src="jquery.min.js"></script>
    <script src="kendo.dataviz.min.js"></script>
    <script src="console.js"></script>
    <link href="kendo.dataviz.min.css" rel="stylesheet" />
</head>
<body>
<div id="example" class="k-content">
            <div class="chart-wrapper">
                <div id="chart"></div>
            </div>
<script>
 
        function createChart() {
                     
var dataSource = new kendo.data.DataSource({
    transport: {
        read: {
            url: "deneme.json",
            dataType: "json",
            contentType: "application/json; charset=utf-8"
        }
    }
});
  
 $("#chart").kendoChart({
  dataSource: dataSource,
  theme: $(document).data("kendoSkin") || "default",
   legend: {
   position: "top",
 },
  chartArea: {
   background: "",
 },
 series: [{
  field: "value",
 }],
  categoryAxis: {
  field: "year",
 }
});
}
    
</script>
</div>
 
</body>
</html>





JSON FILE : 

[ { "year": "2000", "value": 200 }, 
  { "year": "2001", "value": 450 }, 
  { "year": "2002", "value": 300 }, 
  { "year": "2003", "value": 125 },
]




They all in same directory.... 


Thanks
King regards
Iliana Dyankova
Telerik team
 answered on 07 May 2012
0 answers
81 views
Trying to move from 2011.3.1413 to 2012.1.423 version.
Some columns in grid use FCBKcomplete(For it's tags support) widget in incell editor. This widget is composed of hidden select and visible text input. Problem is that text input is autobinded to datasource.
Here is small jsFiddle to illustrate - check the category column in edit mode.
I couldn't find a way to disable this autobinding behaviour. May be i just was looking in wrong direction.

PS: Sorry title must be "Trouble with incell editor..."
Sergey
Top achievements
Rank 1
 asked on 07 May 2012
6 answers
398 views
Hi,

I'm trying to build a billing system using a grid to select the items that are billable in a time range. I have the following php file that feeds the grid and handles the post as in the blog tutorials. When the Save button is clicked the grid posts to the php page correctly but the update does not happen and I get the following error in firebug:

a is undefined
http://localhost/...../kendo.all.min.js
Line 8

Here's the php code:

<?php
$link = mysql_pconnect("localhost", "user", "pass") or die("Unable To Connect To Database Server");
mysql_select_db("db-name") or die("Unable To Connect To DB");

// add the header line to specify that the content type is JSON
header("Content-type: application/json");

// determine the request type
$verb = $_SERVER["REQUEST_METHOD"];

// handle a GET
if ($verb == "GET") {

$arr = array();
$rs = mysql_query("SELECT
contracts_copy.contractID AS ID,
contracts_copy.artistID,
contracts_copy.contract_number AS Contract,
contracts_copy.play_date AS Date,
contracts_copy.billable AS Billable
FROM
contracts_copy
WHERE
contracts_copy.play_date >= '2012-01-01' AND
contracts_copy.offer_status = 'Confirmed'
");
 
while($obj = mysql_fetch_object($rs)) {
    $arr[] = $obj;
}

echo "{\"data\":" .json_encode($arr). "}";
}

    // handle a POST
if ($verb == "POST") {

     // get the parameters from the post. escape them to protect against sql injection.
    $Billable = mysql_real_escape_string($_POST["Billable"]);
    $Id = mysql_real_escape_string($_POST["ID"]);
    
    $rs = mysql_query("UPDATE contracts_copy SET billable = '" .$Billable."' WHERE contractID = '" .$Id."'");
   
   if ($rs) {
        echo json_encode($rs);
    }
    else {
        header("HTTP/1.1 500 Internal Server Error");
        echo "Update failed for ID: " .$Id;
    }
}
?>

When viewing the json directly in the browser it works fine. The post from the grid looks fine too:

models[0][Billable] true
models[0][Contract] EK.03.29-30.2012.HollySprings.NC
models[0][Date] 2012-03-29
models[0][ID] 2218
models[0][artistID] 73

The Billable field is the only editable one and is passed correctly. The response from json is also correct...true. But the table is not updated with the Billable value (true) and the grid doesn't show the update.

Here's my page code:

<div id="wrap" class="k-content">
<div id="example" class="k-content">
            <div id="grid"></div>

            <script>
                $(document).ready(function () {
                  dataSource = new kendo.data.DataSource({
                                transport: {
                                        read: "../data/billable.php",
                                        update: {
                                        url: "../data/billable.php",
                                        type: "POST"
                                            }
                                        },
                                    parameterMap: function(options, operation) {
                                    if (operation !== "read" && options.models) {
                                        return {models: kendo.stringify(options.models)};
                                    }
                                },
                            
                            batch: true,
                            autoSync: true,
                             pageSize: 30,
                                schema: {
                                    data: "data",
                                model: {
                                    id: "ID",
                                    fields: {
                                        Contract: { editable: false },
                                        Date: { editable: false},
                                        Billable: {editable: true, type: "boolean" }
                                  
                                    }
                                }
                            }
                        });

                    $("#grid").kendoGrid({
                        dataSource: dataSource,
                        pageable: true,
                        height: 400,
                        toolbar: ["save", "cancel"],
                        columns: [
                            { field:"ID", title: "ID", width: "25px" },
                            { field: "Contract", title:"Contract", width: "150px" },
                            { field: "Date", title:"Date", width: "150px" },
                            { field: "Billable", width: "100px" }
                            ],
                        editable: true
                    });
                });
            </script>
        </div>


</div>

I hope someone can help. It's probably something simple I'm overlooking. It seems odd that I'd get the true response from my php/json page if the update didn't happen?

Any help is appreciated.
Tony
Alexander Valchev
Telerik team
 answered on 07 May 2012
5 answers
584 views
Is it possible to get serialized data from the tree view - json array or something?

Thank you for your help
Ingo
Alex Gyoshev
Telerik team
 answered on 07 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
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
MultiColumnComboBox
Dialog
Chat
DateRangePicker
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?