Telerik Forums
Kendo UI for jQuery Forum
5 answers
427 views
I have a grid with an edit template specified and withing that grid I'm trying to use either render partial or renderaction. Both i've gotten to work with the actually editing and adding that is not my problem. The problem is the data for my partial inside my edittemplate is not being populated with data. Here is my edit template.

@model <BaseFormModel>
@{
    Model.Demographics = Model.GetFormDemographics(Model.PlanActivityId, Model.Id, 0);
}
<div class="modalContent">
    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true)
 
        <fieldset>
            <legend>Edit Events</legend>
            <div>
                <label>Month</label>
                @Html.TextBoxFor(model => model.StartMonth, new { @placeholder = "mm" })/@Html.TextBoxFor(model => model.StartYear, new { @placeholder = "yyyy" })
            </div>
            <div>
                <label>Event Name</label>
                @Html.TextBoxFor(m => m.FormName)
            </div>
            <div>
                <label>Number of brochures distributed(if applicable)</label>
                @Html.TextBoxFor(m => m.Count2, new { @maxlength = 3 })
            </div>
            <div>
                <label>Number of attendees</label>
                @Html.TextBoxFor(m => m.Count, new { @id = "txtNumberOfAttendees" })
            </div>
            <a id="autoPopulate">Populate based on my county census and number of attendees.</a>
            <h2>Target Demographics</h2>
            @*@{
        Html.RenderAction("GetFormDemographics", "Form", new { planActivityId = ViewBag.PlanActivityId, formId = Model.Id, spUserId = 0 });
            }*@
            @{
                Html.RenderPartial("_PartialDemographicsEditor",model: Model.Demographics);
            }
        </fieldset>
    }
</div>
How do I get my renderpartial or renderaction to work or is there some other way to use partials in kendo edittemplates for grids.
Petur Subev
Telerik team
 answered on 22 May 2013
1 answer
312 views
I have a viewmodel that binds a strongly typed model to the view's controls:

Example: <input type="text" placeholder="Address 1" id="CurrentAddress1" data-bind="value: account.CurrentAddress.Address1"> and <input type="text" placeholder="Address 1" id="PermanentAddress1" data-bind="value: account.PermanentAddress.Address1">

I need functionality, that if a checkbox for "Same As" is checked, the Permanent values in other controls get copied over from the Current values as the user enteres them.

Seems that I need to override either the dataSource or the model bindings, but as a new Kendo developer I am wondering how this would be possible. THanks!
Petur Subev
Telerik team
 answered on 22 May 2013
4 answers
272 views
Welcome. I tested PHP wrappers for KendoUI. I found a problem / bug.

If you use AutoComplete control to retrieve data about the elements, such as a telephone, social security number, tax ID, ID, ID card number, barcode, etc are DataSourceResult-> Read () does not return any result.
The problem is the WHERE clause.

private function where($properties, $filter, $all) {
    if (isset($filter->filters)) {
        $logic = ' AND ';
 
        if ($filter->logic == 'or') {
            $logic = ' OR ';
        }
 
        $filters = $filter->filters;
 
        $where = array();
 
        for ($index = 0; $index < count($filters); $index++) {
            $where[] = $this->where($properties, $filters[$index], $all);
        }
 
        $where = implode($logic, $where);
 
        return "($where)";
    }
 
    $field = $filter->field;
 
    if (in_array($field, $properties)) {
        $index = array_search($filter, $all);
 
        $value = ":filter$index";
 
        if ($this->isDate($filter->value)) {
            $field = "date($field)";
            $value = "date($value)";
        }
 
        if ($this->isString($filter->value)) {
            $operator = $this->stringOperators[$filter->operator];
        } else {
            $operator = $this->operators[$filter->operator];
        }
 
        return "$field $operator $value";
    }
}
Should pay attention to excerpt:
if ($this->isString($filter->value)) {
                $operator = $this->stringOperators[$filter->operator];
            } else {
                $operator = $this->operators[$filter->operator];
            }
At the time of transmission by the AutoComplete type information '90080800418 '(Social Security) is used in an incorrect set of operators.

private $stringOperators = array(
        'eq' => 'LIKE',
        'neq' => 'NOT LIKE',
        'doesnotcontain' => 'NOT LIKE',
        'contains' => 'LIKE',
        'startswith' => 'LIKE',
        'endswith' => 'LIKE'
    );
private
$operators = array(
        'eq' => '=',
        'gt' => '>',
        'gte' => '>=',
        'lt' => '<',
        'lte' => '<=',
        'neq' => '!='
    );
The indicator provides information and an operator that has been used is startswith is not in the $operators.
{"filter":{"logic":"and","filters":[{"value":"90080800418","operator":"startswith","field":"kh_Imie","ignoreCase":true}]}}
I leave the matter to think about. It was enough to add operators to the $operators, but it is possible that you will want to develop something else.


Paweł Kasztelan
Top achievements
Rank 2
 answered on 22 May 2013
10 answers
1.1K+ views
Is there any way to programmatically scroll the listview to the top?
I have a listview where I change the contents dynamically and afterwards I would like to scroll to top.
Ryan
Top achievements
Rank 1
 answered on 22 May 2013
1 answer
503 views
In  my case of Kendo grid, datasource is from JSON data. and part of data feed is like following:
"User": {
...
"FirstName": "Joe",
"LastName": "Doe",
"Phone": null,
...
}

And I need to display full name  in column of "Name" in kendo grid
  columns: [
                { field: "User.FirstName+' '+ User.LastName", title: "Name"},
                ...
   ]
and I also set sortable to be true for this grid. And that works well, the grid shows cell as "Joe Doe"

However, the grid doesn't sort by "Name" column and when I tried to click header of column "Name",  it returns error on kendo.core.min.js 
"(function($,undefined){function Class(){}function compilePart(e,t){if(t)return"'"+e.split("'").join("\\'").split('\\"')......."

Could you let me know where I did wrong? Thanks,


Dimo
Telerik team
 answered on 22 May 2013
1 answer
148 views
I am looking for an example of using Kedo Upload, and placing the file/metada in an ODATA data service.

Ideally I would like to relate it to another parent record as well.

Thanks in advance.


T. Tsonev
Telerik team
 answered on 22 May 2013
2 answers
120 views
Hi! I have a problem with iPhone 5 scrolling -- in the simulator after a couple of minutes, I can't scroll. On an iPhone 5, it stops scrolling immediately when the job list loads.

Am I loading the list in a way that could cause it to stop scrolling (show vs init)? Should I scrollview instead of listview? Anyone else having this issue? Is there a fix?

Gist of example

All of the buttons in the layout work perfectly fine, and you can click / tap on the items in the jobsList -- but you just can't scroll the jobslist.
Alexander Valchev
Telerik team
 answered on 22 May 2013
5 answers
270 views
Hello,
I wonder if it's possible to have the Navbar parent element with transparent background like the attachment.

Cristiano
Kamen Bundev
Telerik team
 answered on 22 May 2013
1 answer
401 views
This may be trivial but I tried many ways and just cannot get it right. I have 2 situations where I populate a grid: 
1. I filled the grid from the contents of a table similar to one of the demos.
2. I populate a grid by starting from an empty grid which I populate with data including cells which has an autocomplete editor as well.

I tried different variations of the CRUD example but it seems that if you do not have a read statement in transport the update do not work.

I want to save the contents of the whole grid to a mysql database by using php. Is there an example that I missed or how can this be done?
Vladimir Iliev
Telerik team
 answered on 22 May 2013
1 answer
247 views
In the main grid , I have specified the ClientDetailTemplateId("Temptemplate")

<script id="Temptemplate" type="text/kendo-tmpl">

                    @(Html.Kendo().Grid<NIMROD.Models.Test>()
                        .Name("Testid#")
                        .Columns(columns =>
                        {
                            columns.Bound(o => o.test1).Title("Test");
                            columns.Bound(o => o.test1Qty).HtmlAttributes(new { style = "text-align:right" });
                            columns.Bound(o => o.test2Qty).HtmlAttributes(new { style = "text-align:right" });
                           
                        })

                         .Editable(ed => ed.Mode(GridEditMode.InCell))
                         .Selectable(sel => sel.Mode(GridSelectionMode.Single))                       
                         .Events(ev =>{
                                         ev.Edit("edit");    
                                      })
                         .DataSource(dataSource => dataSource
                                    .Ajax()
                                    .Batch(true)
                                    .Read(read => read.Action("details", "Order"))
                                    .Update("UKEditPhaseReviewDrops", "Order")
                                    .Model(model => { model.Id(p => p.id); })
                                    .Events(ev => {
                                                   ev.RequestEnd("oncomplete");   
                                                   ev.Error("error_handler");  } )
                                    )
                                     .Events(ev =>{
                                         ev.Edit("onPhaseReviewedit");    
                                      })
                         
                         .Events(ev => ev.Save("onsave"))
                         .ToClientTemplate())    
</script>


Our requirement test1qty & test2qty cell should be editable or readonly based on condition .
Validation should be done for each cell by calling the action result ,Validation message should be displayed as javascript alert

Thanks In Advance
Petur Subev
Telerik team
 answered on 22 May 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
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?