Telerik Forums
Kendo UI for jQuery Forum
2 answers
397 views
I'm having trouble getting tab items to stretch vertically based on the height of the parent tabstrip. What is happening is my items div ends up going past the tabstrip div. I cant help but think there is something going on behind the scenes that I'm missing.

Thanks

I have the following layout:

HTML:

<div id="tabstrip">
    <ul>
        <li class="k-state-active">First Tab </li>
        <li>Second Tab </li>
    </ul>
    <div class="workspace">
        <p>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer felis libero, lobortis
            ac rutrum quis, varius a velit. Donec lacus erat, cursus sed porta quis, adipiscing
            et ligula. Duis volutpat, sem pharetra accumsan pharetra, mi ligula cursus felis,
            ac aliquet leo diam eget risus. Integer facilisis, justo cursus venenatis vehicula,
            massa nisl tempor sem, in ullamcorper neque mauris in orci.</p>
    </div>
    <div class="workspace">
        <p>
            Ut orci ligula, varius ac consequat in, rhoncus in dolor. Mauris pulvinar molestie
            accumsan. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere
            cubilia Curae; Aenean velit ligula, pharetra quis aliquam sed, scelerisque sed sapien.
            Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos
            himenaeos. Aliquam dui mi, vulputate vitae pulvinar ac, condimentum sed eros.</p>
    </div>  
</div>

CSS:

#tabstrip
{
    position: absolute;
    top: 40px;
    bottom: 0px;
}

.workspace
{
    height: 100%;
}
Kamen Bundev
Telerik team
 answered on 18 Jan 2012
1 answer
317 views

How would I go about looping through the entire items in a menu but only get the items from the last nested list? Say I have the following menu:

  • Animals
    • cat
    • dog
    • parrot
  • Food
    • Drinks
      • water
      • Pepsi
      • booze
    • Fruit
      • apple
      • pear
      • carrot

The items in bold is what I mean - the end of the line so to speak in each root item.

Kamen Bundev
Telerik team
 answered on 18 Jan 2012
4 answers
204 views
Hi,

Is it possible to have Grid Virtualization +  Filter + Multiple sorting? Or at least Grid Virtualization +  Filter?

I'm looking for something like http://www.smartclient.com/#adaptiveFilter ...so I think Grid Virtualization +  Filter + Multiple sorting could achieve this.

It would be very useful.
Thanks.
Levente Mihaly
Top achievements
Rank 1
 answered on 18 Jan 2012
0 answers
128 views
I have problem with second grid means gridProperty . It not display data. What is the problem ., Please give me the reply for that .
In this code i pass topic_id to changedatasource ,it takes proper URL when i put gridProperty grid in change function then it display proper data but when i select another row then it display another grid it not refresh that.,display multiple grid.i dont want that display multiple grid ..
var dataSource = new kendo.data.DataSource({
                            transport: {
                                        read: {url:"topics.json",
                                          dataType:"json"}
                                          },
                               schema: {
                                model: {
                                            id: "topic_id",
                                fields: {
                                        TopicID: { type: "string" },                    
                                           name: { type: "string" },
                                        parent_topic_name: { type: "string" },
                                        owner_name: { type: "string" },
                                        description: {type: "string"},
                                            }
                                    }
                                    },
                            pageSize: 8,
                        });
                var selectedTopic;    
                var changedatasource;
$("#grid").kendoGrid({
    dataSource: dataSource,   
    pageable: true,
    sortable: true,
    selectable: true,
    toolbar: kendo.template($("#template").html()),
    columns: ["topic_id", "name","parent_topic_name","owner_name","description"],
    change: function() {
 
         var id = this.select().data("id");
         selectedTopic = this.dataSource.get(id);
        $("#log")
            .html(selectedTopic.get("parent_topic_name") + " > " + selectedTopic.get("name") + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +"\
                  Owned By :" +selectedTopic.get("owner_name"));
        $("#desc")
            .html("Description : " + "<br>" +selectedTopic.get("description"));
        $("#tID")
            .html("ID : " + "<br>" +selectedTopic.get("topic_id"));    
             changedatasource = new kendo.data.DataSource({
                        transport: {
                                 read: {url:selectedTopic.get("topic_id")+"/properties.json",
                                  dataType:"json"}
                                },
                               schema: {
                                model: {
                                            id: "topic_property_id",
                                fields: {
                                        topic_property_id: { type: "string" },                    
                                           name: { type: "string" },
                                        data_type: { type: "string" },
                                        sort_order: { type: "number" },
                                        description: {type: "string"},
                                            }
                                    }
                                    },
                            pageSize: 5,
                        });
                    
    }
});
 $("#gridProperty").kendoGrid({
        dataSource:changedatasource,
        height: 250,
        columns: ["name","data_type","sort_order","description"]
     });
Mahesh
Top achievements
Rank 1
 asked on 18 Jan 2012
1 answer
199 views
I'm trying to add an image to a row in a grid without using a row template. You can see how I'm trying to do this below:
columns: [{
            field: "Title",
            title: "Title",
            format: "<img src='/Images/${ SKU }_small.jpg' alt='${ Title }' />"
        }, {
            field: "OFLC",
            title: "Rating",
            width: 55
        }, {
            field: "Price",
            title: "Price",
            template: "$${ Price }"
        }]

The result is this:
<img src='/Images/${ SKU }_small.jpg' alt='${ Title }' />
showing up instead of the image...

Is it possible to acheive without a row template?
Nikolay Rusev
Telerik team
 answered on 18 Jan 2012
1 answer
90 views
Hello

I want to customize the texts of kendo grid. How can I make this?:

Toolbar:
- Save Changes  (save)
- Cancel changes (cancel)

Commands:
- Delete (destroy). When I try to delete a row it appears a modal box that asks me if I really want to delete it ("Are you sure you want to delete this record?"), I'd like to change it too.

Is there any easy way to change it?

Thanks a lot.
Nikolay Rusev
Telerik team
 answered on 18 Jan 2012
1 answer
167 views
Hi everyone,

Just discovered the Kendo UI. Awsome!
I'm trying to add a button to open a window with datepicker on a grid and it seems to be tricky...
The datepicker should then update a SQL database but i will check through odata later.

Here is the first code:
*edit: here is my try with the window code:
<head>
    <title>Test</title>
     
    <link href="styles/kendo.common.css" rel="stylesheet"/>
    <link href="styles/kendo.silver.css" rel="stylesheet"/>
    <link href="styles/common.css" rel="stylesheet"/>
         
    <script src="js/jquery.min.js"></script>   
    <script src="js/kendo.core.min.js"></script>
     
    <script src="js/kendo.fx.min.js">//Menu</script>
    <script src="js/kendo.popup.min.js"></script>
    <script src="js/kendo.menu.min.js"></script>
     
    <script src="js/kendo.data.min.js">//Grid</script>
    <script src="js/kendo.pager.min.js"></script>
    <script src="js/kendo.sortable.min.js"></script>
    <script src="js/kendo.draganddrop.min.js"></script>
    <script src="js/kendo.groupable.min.js"></script>
    <script src="js/kendo.grid.min.js"></script>
     
    <script src="js/kendo.resizable.min.js">//Windows</script>
    <script src="js/kendo.window.min.js"></script>
 
     
</head>
<body>
<div id="main">
    <?php include("menu.php"); ?>
    <div id="content">
        <div id="grid"></div>
    </div>
<script>
function createData() {
    var data = [];
<?php
$mysql_serveur = "localhost";
$mysql_pseudo = "root";
$mysql_pass = "";
$mysql_bdd = "test";
$connexion = mysql_pconnect($mysql_serveur,$mysql_pseudo,$mysql_pass) or die("Erreur1");
if(!$connexion ) die("Erreur2");
if(!mysql_select_db($mysql_bdd)) die("Erreur3");
$sql = "SELECT * FROM table ORDER BY DUE";
$req = mysql_query($sql);
$datejour=date("Y-m-d");
$djour = explode("-", $datejour);
while ($row = mysql_fetch_assoc($req)){
    $dfin = explode("-", $row['DUE']);
    if($dfin<$djour){
        if($row['START']<>0) {$start=$row['START'];} else{
            $start="<span id='date' class='".$row['NUM']."'>Select</span>";
        }
        if($row['DESC']<>"") {$des="Description";} else{$des="";}
        echo 'data.push({
            ID: "'.$row['NUM'].'",
            NOM: "'.$row['NOM'].'",
            DEP: "'.$row['DEP'].'",
            DUE: "'.$row['DUE'].'",
            DES: "'.$des.'",
            START: "'.$start.'",
            COMP: "'.$row['DONE'].'"
        });';
    }
}
?>
   return data;
}
</script>
<script>
    $(document).ready(function() {
        $("#menu").kendoMenu();
        var getEffects = function () {
             return ($("#opacity")[0].checked ? "fadeIn" : "");
        };
        var initMenu = function () {
            $("#menu").kendoMenu({
            animation: { open: { effects: getEffects() } },
                hoverDelay: 2
            })
        };
        $("#grid").kendoGrid({
            dataSource: {data: createData(),pageSize: 20},
                height: 360,
                groupable: true,
                scrollable: true,
                sortable: true,
                pageable: true,
                columns: [
                    {field: "NOM", width: 150, title: "Name" },
                    {field: "DEP",width: 40,title: "Depth"},
                    {field: "DES",width: 30,title: "Description",template:'<a href="description.php?des=#=ID#">#=DES#</a>'},
                    {field: "DUE",width: 30,title: "Due date"},
                    {width: 50,title: "Started",template:'#=START#'},
                    {width: 30,title: "Completed",template:'<a href="maj.php?comp=#=ID#">Select</a>'}
                ]
        });
    });
        initMenu();
</script>
<script>
    $(document).ready(function() {
        var window = $("#window"),
                        date = $("#date")
                                .bind("click", function() {
                                    window.date("kendoWindow").open();
                                });
        if (!window.data("kendoWindow")) {
                        window.kendoWindow({
                            width: "500px",
                            title: "Pick a date",
                            actions: ["Refresh", "Close"],
                            content: 'ajaxContent.html',
                            open: onOpen,
                            activate: onActivate,
                            close: onClose,
                            deactivate: onDeactivate,
                            resize: onResize,
                            dragend: onDragEnd,
                            refresh: onRefresh
                        });
                    }
    });
</script>
<div id="window"></div>
        </div>
</div>
    </body>

Where are the mistakes?
Gy
Top achievements
Rank 1
 answered on 18 Jan 2012
4 answers
282 views
// line 822
if (options.content && !isLocalUrl(options.content)) {
            contentHtml.html(templates.iframe(options));
        }

I think it's worth to give the programmer to decide on the insertiframe. It may be helpful:)

Alex Gyoshev
Telerik team
 answered on 18 Jan 2012
1 answer
336 views
I have a selectable grid and I want to be able to drag the selected row into a drop target.

I tried attaching kendoDraggable on all the grid rows to make all the rows draggle something like this:

$("#grid tr").kendoDraggable({
hint: function() {
var g = $("#grid").data("kendoGrid")
return g.select().clone()
},
dragstart: function() { console.log("drag start");},
dragend: function() {console.log("drag end");}
});

Unfortunately, this doesn't work. What I am doing wrong?
Numan
Top achievements
Rank 1
 answered on 17 Jan 2012
2 answers
590 views
I have a shared DataSouce that I wish to bind to multiple UI elements (dropdown and chart).

The DataSource has a change event so I can intercept the data.

What I observe is that EACH UI element seems to cause the DataSource to execute rather than the first one only.

Here is some code to illustrate :-

var metaDataSource
    ;
 
function createPieChart() {
    $("#pie").kendoChart({
        dataSource: metaDataSource,
        title: {
            text: "Total XDC Hits"
        },
        legend: {
            position: "bottom"
        },
        seriesDefaults: {
            type: "pie",
            labels: {
                visible: "true",
                template: "#= kendo.format('{0:P}', percentage)#"           
            }
        },
        series:
        [{
            field: "TotalHits",
            categoryField: "Name"
        }],
        chartArea: {
            height: 300,
            margin: 1
        },
        plotArea: {
            margin: 1
        }
    });
}
 
function createList() {
     $("#list").kendoDropDownList({
        index: 0,
        dataSource : metaDataSource,
        dataTextField: "Name",
        dataValueField: "ID",
        change: onSelectXDC
    });
}
 
function onSelectXDC() {
    var dl=$("#list").data("kendoDropDownList");
    var txt = dl.text();
    var val = dl.value();
    log(kendo.format("Select XDC :: {0} {1}", txt, val ));
}
 
function OnListXDC(e) {
    var view = metaDataSource.view();
    log(kendo.format("ds listxdc, #rows={0}",view.length));
    $(view).each(function() {
        log(kendo.format("ID={0}, Name={1}, Hits={2}",this.ID,this.Name,this.TotalHits));
    });
}
 
$(document).ready(function(){
    metaDataSource = new kendo.data.DataSource({
        transport: {
            read: {
                url: "/metrics/listxdc",
                data: {
                    json: "true",
                    simu: "true"
                }
            }
        },
        schema: {
            model: {
                fields: {
                    ID: { type: "number" },
                    Name: { type: "string" },
                    Path: { type: "string" },
                    TotalHits: { type: "number" }
                }
            }
        },
        change: OnListXDC
    });
 
    createList();
    createPieChart();
});

I define the DataSource and then call createList to use this with a dropdown.  This works and I see the change event for the DataSource as expected.

Next, I call createPieChart to use the same DataSource BUT I get another change on the DataSource and another network call is made?

I wish for there to be a single network call and for the results to be bound to the two UI elements until I call .read() on the DataSource to trigger an update.

Can you please take a look and see if I am doing something wrong here?
John
Top achievements
Rank 1
 answered on 17 Jan 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
Drag and Drop
Application
Map
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
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?