Telerik Forums
Kendo UI for jQuery Forum
2 answers
1.0K+ views

Hello, I have following external template script. there is MVVM grid id=" initially  want it to get . In make jquery ajax call and on success when bind the grid the data show

kendo.bind($("#TSTGrid"), response);   // when executed doesnt show data

 

ajax success code:

$.ajax({
               type: "POST",
               dataType: "json",
               url: rootUrl("Fare/GetFareFamiliesMVVM"),
               data: {
                   pricingVm: AirPricingWoPNRViewModel.Item.AirPricingVM.toJSON(), command:cmd
               },
               success: function (response) {
                   debugger;
                  kendo.bind($("#TSTGrid"), response);
                    
                   kendo.ui.progress($("#AirPricingContainer"), false);
               },
               error: function (xhr, ajaxOptions, thrownError) {
                   debugger;
                   kendo.ui.progress($("#AirPricingContainer"), false);
               }
           });

 

 

template script:

<script id="PricingHeader" type="text/x-kendo-template" class="KendoExtTemplate">
     <div class="row-fluid">
         <div id="FareFilterHeader" class="span9">
             <label class="vc-label">VC</label>
             <input type="text" data-role="autocomplete" validationMessage="Validating Carrier is Invalid/Required" id="validatingcarrier"
                    data-min-length="2" data-value-primitive="false" data-highlight-first="true" class="validating-carrier-autocomplete"
                    data-text-field="airline_value" data-template="AirportItemTemplate" title="Validating Carrier" required="required"
                    data-bind="value: ValidatingCarrier,source: ValidatingCarrierSource, events: {change: ValidatingCarrierOnChange,open : ValidatingCarrierOnOpen,select : ValidatingCarrierOnSelect }" />
 
             <label>Supplier</label>
             <input type="text" data-role="autocomplete" class="supplier-autocomplete" required="required" name="supplierpricing" id="supplierpricing"
                    data-min-length="2" data-value-primitive="false" data-highlight-first="true" data-template="SupplierItemTemplate"
                    data-text-field="Name" title="Supplier" validationMessage="Supplier is Invalid/Required" data-supplier-msg="Supplier is invalid"
                    data-bind="value: OptionFilters.SupplierInfo, source: FareOptionsSupplierSource, events: {change: SupplierPricingOnChange,open : SupplierPricingOnOpen
            ,select : SupplierPricingOnSelect}}" />
 
             <label class="fare-type-label">Fare Type</label>
             <input data-role="dropdownlist" required="required"
                    data-text-field="Description" validationMessage="Fare Type is Invalid/Required" data-value-field="Value"
                    data-value-primitive="true" data-bind="value: OptionFilters.FareTypeCode,source: FareTypeSource ,
             events: {change: FareTypeOnChange}" />
 
             <input data-role="dropdownlist" class="fare-template"
                    data-text-field="Name" data-template="FareItemTemplate"
                    data-value-field="Id" required="required"
                    data-value-primitive="true"
                    data-bind="value: FareTemplateID,
                    source: PricingTemplateSource" />
 
 
             <button class="k-button pricing-window-action-btn" data-bind="click: GetFareFamiliesByInformativePrice" type="button">Informative</button>
             <button class="k-button pricing-window-action-btn" data-bind="click: GetFareFamiliesByBestPrice" type="button">Best</button>
 
 
             <div data-role="grid" id="TSTGrid" class="fare-basis-grid"
                  data-columns='[
                      { "field": "Segments", "title": "FareBasis"},
                  {"field": "Segments","title":"Cabin"},
                  {"field": "Segments","title":"Segment"},
                  {"field": "UnitQualifier","title":"PTC"},
                  {"field": "Quantity","title":"Qty"},
                  {"field": "SupplierCommercials.SupplierHeads.NetFareInclTax","title":"Total"},
                  {"title":"Action",command: [
                     { text: "Select", click: AirPricingWoPNRViewModel.Item.SelectFareFamily, title: "Action"}
 
                  ]}
                  ]' data-row-template="FareFamilyRowTemplate"></div>
 
             <div data-template="PricingCommercialTemplate" id="PricingCommercialContainer" ></div>
         </div>
 
         <div class="span3" id="SegPaxInfoDiv">
             <div>
                 <b><i class="fa fa-plane passenger-plane-icon" aria-hidden="true"></i> Segments</b>
                 <table data-bind="source: Segments" id="Segments" data-template="SegmentTemplate" class="courierfont"></table>
 
             </div>
             <div class="passenger-div">
                 <b><i class="fa fa-users passenger-user-icon" aria-hidden="true"></i> Passengers</b>
                 <table data-bind="source: PNRPassengerInfos" data-template="PassengerTemplate" class="courierfont"></table>
 
             </div>
         </div>
     </div>
 
 
 </script>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Stefan
Telerik team
 answered on 22 Sep 2017
4 answers
153 views

We have a command column in our grids that is sensitive to user level states. All users have a View button, but only the item owners have an Edit button, the remaining Edit buttons being hidden from view. When a sort is applied, the button connections are update correctly, but the button states are not conveyed with the sort. Therefore, the visible Edit buttons do not convey with their intended associated items.

While I view this potentially as a bug more so than a feature, I am hoping there is an intervention workaround that can be implemented which allows us to change the visibility or enabled state of the buttons to the properly associated columns. I also wanted to alert Telerik that the expected behavior is that button states should sort within the grid as well, rather than just the data or function binding.

For example, in a ten row grid, items 2 and 8 are visible, but the rest are hidden. When sort is applied to a column, 2 and 8 move to 1 and 5, and the associations are correct, but the Edit buttons for 2 and 8 are still visible, and the Edit buttons for 1 and 5 are not.

No code should be necessary with this explanation, but if more data is needed, please let me know. Any recommendations?

Bill Edwards

Stefan
Telerik team
 answered on 21 Sep 2017
1 answer
206 views

Hi Telerik,

Is it possible to set the width of event A to 80% and width of event B to 20% ?

Thanks

 

Dimitar
Telerik team
 answered on 21 Sep 2017
1 answer
518 views

The user story:  

- I hit the NEW (Insert) Button in the Grid toolbar.  (k-grid-add)

- After inserting the data in the Popup editor, I hit the k-grid-update Button in the Popup editor.

- The Popup editor should stay open with a new record, or at least auto-reopen, so I can go on with entering the next record.

 

Is there a way to have an "insert and add another row" Button to stay in the Popup editor?

I tried all combinations of addRow from the Grid API, but I allways get an Uncaught TypeError

 

kendo.all.js:10682 Uncaught TypeError: Cannot read property 'uid' of undefined

    at init.cancelRow (kendo.all.js:10682)
    at init.editRow (kendo.all.js:10401)
    at init.addRow (kendo.all.js:10876)
    at Object.complete (index:3034)
    at i (jquery.min.js:2)
    at Object.fireWith (jquery.min.js:2)
    at y (jquery.min.js:4)
    at XMLHttpRequest.c (jquery.min.js:4)

 

Thanks for the support.

 

 

JanLeu
Top achievements
Rank 1
 answered on 21 Sep 2017
1 answer
471 views
I do apologize in advance for the bad post

I am implementing a kendo grid for filtering information, My first filter is giving me so much issues and i now have to ask forum because nothing works that i try.

Issues:

1. When selecting filter on the column below, I can not focus on the numericTextBox to input values I am forced to use spinners only.

2. When using spinners its history is always off by 1, Example: I click it twice (Up) and the value = 2. When I filter the row returns No: 1 and when inspecting the filter it is now 1 and not 2.

Code Grid:

 @(Html.Kendo().Grid<DeBeers.Seals.Web.Models.SearchSealsModel>()
                            .HtmlAttributes(new { @style = "-ms-overflow-x: scroll !important" })
                            .Name("grid")
                            .DataSource(dataSource => dataSource
                              .Ajax()
                             .Read(read => read.Action("Read", "SearchSeals"))
                            )
                            .Columns(columns =>
                            {
                                columns.Bound(b => b.SealNum).Filterable(filterable => filterable.UI("sealNumFilter"));

    })
                            .Pageable()
                            .Sortable()
                            .Filterable(ftb => ftb.Mode(GridFilterMode.Menu))



Code Script:

function sealNumFilter(element) {
                debugger;
                element.kendoNumericTextBox({
                    decimals: 0,
                    format: "n0",
                    //spinners: false,
                })
                //    .focus(function () {
                //    var input = $(this);
                //    setTimeout(function () {
                //        input.select();
                //    });
                //});
            }
Viktor Tachev
Telerik team
 answered on 21 Sep 2017
11 answers
442 views
Hi:

I recently added a forum post, but attached the wrong image.  How do I remove the image?

Phil
Veselin Tsvetanov
Telerik team
 answered on 21 Sep 2017
2 answers
387 views
Which files does mediaplayer support?
Preslav
Telerik team
 answered on 21 Sep 2017
1 answer
181 views

As per the documentation, we can filter the datasource with only one logic: either "or" or "and". I need to filter as per the following logic:

(condition 1) and ((condition 2) or (condition 3))

Is it possible?

If not, is there in the operator something like "in" so that I can do the following logic:

(condition 1) and ( x in ("value 1", "value 2"))?

 

Tsvetina
Telerik team
 answered on 21 Sep 2017
2 answers
150 views

I have a grid

@(Html.Kendo().Grid<TaskViewModel>()
.Name("taskGrid")
.Deferred()

...

.Columns(columns =>
{
columns.Bound(e => e.CrmWorkflowStatusText).Title("WF Status").Filterable(x => x.UI("SomeFunction")
.Extra(false)
.Operators(k => k
  .ForString(str => str.Clear()
  .IsEqualTo("Is equal to")
  .IsNotEqualTo("Is not equal to")

)));
})

...

.DataSource(dataSource => dataSource

...

))

that has a dropdownlist to filter one of the columns

 

function SomeFunction(element) {

const checkBoxTemplate = '@(Html.Kendo().CheckBox().Name("#:Title#").HtmlAttributes(new { @class = "checkbox", onchange = "SomeOtherFunction(this)" }))';

element.kendoDropDownList({

dataSource: {

transport: {

read: "@Url.Action("SomeAction")"

}},

optionLabel: "Select Something",

dataTextField: "Title",

dataValueField: "Title",

open: adjustDropDownWidth,

template: "<span><label>" + checkBoxTemplate + "<span id='#= Title #'>#= Title #</span></label></span>"

});

}

My problem is setting the id of this dropdownlist. I tried

 name: "somename"

and

htmlAttributes: { id: "somename" }


hmtlAttributes does nothing and name: "somename" sets the data-role attribute to "somename"...

 <input title="Value" style="display: none;" type="text" data-role="test123" data-bind="value:filters[0].value">

Is there a way to fix this?

Rui
Top achievements
Rank 1
 answered on 21 Sep 2017
5 answers
320 views
The combination "groupable" and "selection" is not working. When I wrote the code like example(http://plnkr.co/edit/DlQCEsjJW55b5jffnG1b?p=preview) combination the function bring the incorrect index values.
onSelectionChange(event) { alert(event.index); }
Any idea ?
Dimiter Topalov
Telerik team
 answered on 21 Sep 2017
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?