Telerik Forums
Kendo UI for jQuery Forum
4 answers
1.9K+ views
I would like to have my command button display different text based on the values in the row.  I have tried

command: [{
    name: "return",
    click: myHandler,
    template: '#= getCommandText(col1, col2) #'
}]
 
function getCommandText(c1, c2) {
      //return text based on values in this row
}
 
function myHandler(e) {
    //perform actions based on value in row
}

But the command's template call doesn't seem to be aware of values in the row like field columns do. 

I suppose another alternative would be to have multiple commands in a column, and hide certain ones based on the values in the row, but I am not sure how to do this either.

Thanks,
~S
Henrik
Top achievements
Rank 1
 answered on 24 Sep 2013
1 answer
133 views
Hi,

Does anybody know how can I add a confirmation pop-up on re-size event, and cancel changes when the user click cancel button?.
The sample scenario is like this:
  • when the user resize an event/schedule, a pop-up window will display with a message saying.. "Re-sizing this event will update the time range." with a two button which is "Ok" and "Cancel".
  • So, when the user click "Ok" re-size will do his function as default which update the event/schedule
  • else, if the user click the "Cancel", re-sizing of event/schedule will be cancelled.. means cancel any changes to the schedule.
I know how to pop-up the window.. but I can't figure it out how to cancel changes when user click the "Cancel button".
Thanks.

Regards,
Jesson
Rosen
Telerik team
 answered on 24 Sep 2013
1 answer
103 views
This is probably more a request than a bug.

I'm using the <optgroup> tag to group the options in my select. The MultiSelect widget converts them to "undefined" items. Is the optgroup tag supposed to be supported? If not, could it be in the future?

Thanks
Georgi Krustev
Telerik team
 answered on 24 Sep 2013
1 answer
335 views
Hi,

I need to make some of the items in the combobox to act like headers, therefore I need them to be not clickable,  is this possible?

I'm planning in using templates for both the headers (no clickable) and the children elements (the clickable options)

Thank,
Ignacio
Georgi Krustev
Telerik team
 answered on 24 Sep 2013
1 answer
333 views
hello
in my complete mobile web app i got the same problem wenn redirecting to a new site with click on a button

example:
iam on site: www.host.org/home/index
and i want to: www.host.org/mail/inbox

on click the button redirects to correct site but the url is now www.host.org/home/index#/mail/inbox

its no big thing, main features are still working, but i ran into some update and refresh issues. for example: after a redirect and creating of a this kind of a monster url badges on buttons are no longer displayed. even refresh don let them appear. only tiping the correct url fixes it.
i also have problems with login and out becouse of this kind of url


example for a button :
<a data-role="button" href="/projekte/index"> <img src="~/Content/images/icons/48x48/projekte48.png" /> Projekte </a>

or my "login button"
<a data-click="login" id="modalview-login-button" type="button" data-role="button">Login</a>
<script>
//...

$.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; chaset=utf-8",
        dataType: "json",
        success: function (data) { if (data.Success) { app.navigate("/home/index"); closeModalView(); } }
    });

//...
</script>
Petyo
Telerik team
 answered on 24 Sep 2013
1 answer
83 views
hi all, I'm developing an app with PhoneGap and KendoUI; I'm brand new to both of these frameworks so forgive my potential ignorance.

I have a single html file with multiple data-role="view" views, within the phonegap JS I am watching for state changes, on "deviceready" i'd like to change from my default "Loading" view to my login view.

My question is: is there an elegant, KendoUI method to trigger this view change? If not, do I simply .hide() the one and .show() the other?

Thanks
Daniel
Telerik team
 answered on 24 Sep 2013
1 answer
74 views
I am using a kendo grid (2012.2.803.340). I am binding data
on read action. It always fires correctly. But on Ajax post, it does not fire.
Other than Firefox browser, it works fine.
Nikolay Rusev
Telerik team
 answered on 24 Sep 2013
14 answers
527 views
I seem to be having trouble displaying events in the calendar. I know that I am able to get the JSON results without an issue as I created a test page which simply echo's the JSON results. I must be missing something in the code I modified and likely it is very, very simple. On a side note, the scheduler page is loaded up within a tab strip item, but I don't think that makes a difference as I don't see the results when I connect to the page directly.

Help is much appreciated...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Appointment Schedular</title>
    <link href="css/Autovation.css" rel="stylesheet" />
    <link href="css/kendo.common.min.css" rel="stylesheet" />
    <link href="css/kendo.default.min.css" rel="stylesheet" />
    <script src="js/jquery.min.js"></script>
    <script src="js/kendo.all.min.js"></script>
</head>
 
<script id="editor" type="text/x-kendo-template">
   <h3>Edit meeting</h3>
   <p>
       <label>Title: <input name="title" /></label>
   </p>
   <p>
       <label>Start: <input data-role="datetimepicker" name="start" /></label>
   </p>
   <p>
       <label>Start: <input data-role="datetimepicker" name="end" /></label>
   </p>
</script>
 
<?php
 
 
require_once 'dbModules/DataSourceResult.php';
require_once 'dbModules/SchedulerDataSourceResult.php';
require_once 'Kendo/Autoload.php';
 
 
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
 
    $request = json_decode(file_get_contents('php://input'));
 
    $result = new SchedulerDataSourceResult('mysql:host=localhost;dbname=appdata', 'root', '...');
 
    $type = $_GET['type'];
 
    $columns = array('ID', 'EstimateID', 'CustomerID', 'Subject', 'Location', 'Description', 'StartTime', 'EndTime', 'VehicleType','IsAllDay', 'Synchronized');
 
    switch($type) {
        case 'create':
            $result = $result->create('Appointments', $columns, $request->models, 'ID');
            break;
        case 'update':
            $result = $result->update('Appointments', $columns, $request->models, 'ID');
            break;
        case 'destroy':
            $result = $result->destroy('Appointments', $request->models, 'ID');
            break;
        default:
            $result = $result->read('Appointments', array('ID'), $request);
            break;
    }
 
    echo json_encode($result, JSON_NUMERIC_CHECK);
 
    exit;
}
 
$transport = new \Kendo\Data\DataSourceTransport();
 
$create = new \Kendo\Data\DataSourceTransportCreate();
 
$create->url('scheduler.php?type=create')
       ->contentType('application/json')
       ->type('POST');
 
$read = new \Kendo\Data\DataSourceTransportRead();
 
$read->url('scheduler.php?type=read')
     ->contentType('application/json')
       ->type('POST');
 
$update = new \Kendo\Data\DataSourceTransportUpdate();
 
$update->url('scheduler.php?type=update')
       ->contentType('application/json')
       ->type('POST');
 
$destroy = new \Kendo\Data\DataSourceTransportDestroy();
 
$destroy->url('scheduler.php?type=destroy')
        ->contentType('application/json')
        ->type('POST');
 
$transport->create($create)
          ->read($read)
          ->update($update)
          ->destroy($destroy)
          ->parameterMap('function(data) {
              return kendo.stringify(data);
          }');
 
$model = new \Kendo\Data\DataSourceSchemaModel();
 
$IDField = new \Kendo\Data\DataSourceSchemaModelField('ID');
$IDField->type('number')
        ->from('ID')
        ->nullable(false);
 
$estimateID = new \Kendo\Data\DataSourceSchemaModelField('EstimateID');
$estimateID->type('number')
           ->from('EstimateID')
           ->defaultValue('No title')
           ->validation(array('required' => true));
 
$customerID = new \Kendo\Data\DataSourceSchemaModelField('CustomerID');
$customerID->type('number')
           ->from('CustomerID')
           ->defaultValue('No title')
           ->validation(array('required' => true));
 
$subjectField = new \Kendo\Data\DataSourceSchemaModelField('Subject');
$subjectField->type('string')
             ->from('Subject');
 
$locationField = new \Kendo\Data\DataSourceSchemaModelField('Location');
$locationField->type('string')
              ->from('Location');
         
$descriptionField = new \Kendo\Data\DataSourceSchemaModelField('Description');
$descriptionField->type('string')
                 ->from('Description');
 
 
$startField = new \Kendo\Data\DataSourceSchemaModelField('StartTime');
$startField->type('datetime')
           ->from('StartTime');
 
$endField = new \Kendo\Data\DataSourceSchemaModelField('EndTime');
$endField->type('datetime')
         ->from('EndTime');
 
$vehicleTypeField = new \Kendo\Data\DataSourceSchemaModelField('VehicleType');
$vehicleTypeField->type('string')
                 ->from('VehicleType');
 
$isAllDayField = new \Kendo\Data\DataSourceSchemaModelField('IsAllDay');
$isAllDayField->type('boolean')
              ->from('IsAllDay');
 
 
$SynchronizedField = new \Kendo\Data\DataSourceSchemaModelField('Synchronized');
$SynchronizedField->type('boolean')
                          ->from('Synchronized');
 
$model->id('ID');
$model->addField($IDField);
$model->addField($estimateID);
$model->addField($customerID);
$model->addField($subjectField);
$model->addField($locationField);
$model->addField($descriptionField);
$model->addField($startField);
$model->addField($endField);
$model->addField($vehicleTypeField);
$model->addField($isAllDayField);
$model->addField($SynchronizedField);
 
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')
        ->errors('errors')
        ->model($model);
 
$dataSource = new \Kendo\Data\DataSource();
 
$dataSource->transport($transport)
    ->schema($schema)
    ->batch(true);
 
//$editable = new \Kendo\UI\SchedulerEditable();
//$confirmation = true;
//$editable->confirmation($confirmation);
//$editable->template('$editor')//;
 
$scheduler = new \Kendo\UI\Scheduler('scheduler');
$scheduler->timezone('America/Toronto')
        ->date(new DateTime())
        ->height('850')
        ->addView(array('type' => 'day', 'startTime' => new DateTime('7:00',new DateTimeZone('America/Toronto'))),
            array('type' => 'week', 'selected' => true, 'startTime' => new DateTime('7:00',new DateTimeZone('America/Toronto'))), 'month', 'agenda')
        ->dataSource($dataSource);
 
?>
<?php
echo $scheduler->render();
?>
Pavel
Top achievements
Rank 1
 answered on 24 Sep 2013
1 answer
92 views
I have been tearing apart these blogs to find my answers since they are not yet in the (beta) documentation.  My understanding is I should be able to pass data back to my ReST call by specifying what fields I want in the "parameterMap".  I can see the transfer happening in the browser.  Unfortunately this data is not to be found when I break in my controller code where the TaskViewModel is a parameter. Oh, and the "options.model" value is null inside the parameterMap function I have.

Am I correct in assuming this transfer of values from the parameterMap to the controller happens through the TaskViewModel?  Or do I need to connect something manually?  HOW DO I GET MY VALUES TO THE CONTROLLER?  help please
Entilzha
Top achievements
Rank 2
 answered on 24 Sep 2013
2 answers
274 views
Hi 

Using MVVM techniques I have bound a dropdown list like this (this element is sitting within a Kendo UI mobile View):

    <select id="treatmentTypesSelect" name="TreatmentTypes" data-role="dropdownlist" data-bind="source: TreatmentTypes, value: TreatmentTypeId, events: { click: onTreatmentTypeChange}" data-change="onTreatmentTypeChange" data-text-field="name" data-value-field="value" required required data-required-msg="Treatment Type is required"></select>              

The function onTreatmentTypeChange is defined in the bound viewModel of the View.
                
Using the Icenium simulator the onTreatmentTypeChange event is fired and works properly, but once deployed to an android device the event is no longer raised.

I tried changing it to this:

    <select id="treatmentTypesSelect" name="TreatmentTypes" data-role="dropdownlist" data-bind="source: TreatmentTypes, value: TreatmentTypeId" data-change="onTreatmentTypeChange" data-text-field="name" data-value-field="value" required required data-required-msg="Treatment Type is required"></select>              
But this does not work either.

What is the correct way to bind events (in particular the change event)?
                
Aaron
Top achievements
Rank 2
 answered on 23 Sep 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
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
LLM Kit
+? 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?