Telerik Forums
Kendo UI for jQuery Forum
6 answers
259 views

Hello,
           I have kendo grid in mvvm.

 

<script id="TSTSettlementTemplate" type="text/x-kendo-template">
    <div data-bind="visible: isSettlementGridVisible" class="test67">
 
 
        <div data-role="grid" id="SettlementGrid"
             data-editable="true"
             data-toolbar='[{"template": "<div class=\"toolbar\"><input type=\"button\" class=\"k-button k-button-icontext\" onclick=\"AddSettlementrow(this)\" value=\"+ Add New Record\"/></div>" }]'
             data-columns="[
                   { 'field': 'Entity', 'title': 'Entity', 'width': 110 ,editor: SettlementGridEntityEditor , template: kendo.template($('\\#SettlementEntityDisplay').html()) },
                   { 'field': 'Entity', 'title': 'Entity Type', 'width': 50 , editable: false, editor: nonEditorforEntityTypeDisplay, template: kendo.template($('\\#SettlementEntityTypeDisplay').html()) },
                   { 'field': 'Payer', 'title': 'Payer', 'width': 110 ,editor: SettlementGridPayerEditor , template: kendo.template($('\\#SettlementPayerDisplay').html()) },
                   { 'field': 'SettlementType', 'title': 'Settlement Type', 'width': 110 ,editor: SettlementTypeEntityEditor , template: kendo.template($('\\#SettlementTypeDisplay').html()) },
                   { 'field': 'PaymentMode', 'title': 'Payment Mode', 'width': 150 ,editor: SettlementGridPaymentModeEditor , template: kendo.template($('\\#SettlementPaymentModeDisplay').html()) },
                   { 'field': 'PaidUsing', 'title': 'Paid Using', 'width': 150 ,editor: SettlementGridPaidUsingEditor , template: kendo.template($('\\#SettlementGridCreditCardTemplate').html()) },
                   { 'field': 'Amount', 'title': 'Amount', 'width': 150 ,editor: SettlementGridAmountEditor  },
                   { 'field': 'remark', 'title': 'Remark', 'width': 150 ,editor: SettlementGridRemarkEditor },
                   { text: 'Select', title: 'Action', template: kendo.template($('\\#SettlementGridOperationTemplate').html()) , 'width': 110}
                 ]"
             data-bind="source: settlementgridDS"
             style="height: 200px"></div>
 
         
    </div>
</script>

 

By javascript i programatically set DataSource as below code before binding object to above template :

SettlementVm.Data.settlementgridDS = new kendo.data.DataSource({
                      data: data.PricingSettlements,
                      schema: {
                          model: {
                              id: "ID",
                              fields: {
                                  ID: { type: "number", editable: false, nullable: true }
                                  //Entity: { type: "string", validation: { required: true } },
                                  //Payer: { type: "string", validation: { required: true } },
                                  //SettlementType: { type: "string", validation: { required: true } },
                                  //PaymentMode: { type: "string", validation: { required: true } },
                                  //PaidUsing: { type: "string" },
                                  //Amount: { type: "number", validation: { required: true } },
                                  //PCCCode: { type: "string", validation: { required: true } },
                                  //Remark: { type: "string", validation: { required: true } }
                              }
                          }
                      }
                  });

 

Amount, Remark are simple values rest other columns are complex types.

Problem: When i add new record in kendo grid / or there is existing pre-filled data and when i validate using kendo-Validator it shows no error even if values are not bound. Unless i open edit mode and click on anywhere . Kendo Validator only works when i activate Editor template. 

Question:

1) Can i change In-cell Edit mode to full Grid Edit mode?

2) How to validate columns values if Editor template not called ( user doesnt click on in-cell to open edit mode) ?

  

 

 

 

Eyup
Telerik team
 answered on 19 Oct 2020
3 answers
382 views

Hi,

Is it possible to set the dropZone dynamically?

 

 

Petar
Telerik team
 answered on 16 Oct 2020
1 answer
132 views

I would like all connections made to shapes to use ONLY the centre connector.

In the javascript code I use the diagram.connect method to connect the shapes; I did see an example of the use shape.getConnector method but cannot find any documentation on this. But I felt by doing something like....

 

diagram.connect(shape1.getConnector('middle'),shape2.getConnector('middle')

 

Should actually do what I wanted but using the key word 'middle' or 'center' did not work. Any help appreciated.

Tsvetomir
Telerik team
 answered on 16 Oct 2020
2 answers
305 views

Hello,

the following example renders a wrapped chart label using the drawing API:

https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart/configuration/categoryaxis.labels#categoryaxislabelsvisual

 

Now, if you take this example (https://dojo.telerik.com/ERuyOquh),you can see that the texts are right-aligned. Is it possible to align these centered?

 

Kind regards.

Stefan
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 16 Oct 2020
1 answer
61 views

Hello,

I am currently receiving the dates on my grid as strings and looking for a way to filter them as though they were dates. I tried simply changing the type in the schema from type: 'string' to type: 'date' and as far as the filtering goes this accomplished the goal, my problem now is that I can't seem to change the format of the dates being shown, I am only getting a full JavaScript date object showing as 'Tue Oct 13 2020 00:00:00 GMT-0700 (Pacific Daylight Time).'

Other than the format everything seems to be saving and updating as expected. I have tried simply adding format: "{0:dd-MMM-yyyy}" to the column as well as kendo.parseDate in the template. Any other possible solution I am missing?

Thank you in advance

Petar
Telerik team
 answered on 15 Oct 2020
7 answers
1.1K+ views

    Hi all,

I'm trying to use the persist state feature of the Kendo Grid.

I work with ASP.Net Core (2.1) and JQuery (3.3.1).

I have an issue with the grid.GetOptions(), .SetOptions() and . They always try to post to the page where I'm at. My grid is not configured to go and fetch for the data with the Datasource option of the grid. My data for the grid are passed along the model.

 
Tsvetomir
Telerik team
 answered on 14 Oct 2020
1 answer
124 views

 

Trying to initialize ArcGauge using data attributes.

Nothing seems to happen when I set

data-center-template

or data-colors

See:

https://jsfiddle.net/bglase/cp5g4jen/2/

I expected the gauge color to change based on the selected value, and the numeric value to be shown in the center of the gauge.

 

thanks in advance for any advice

Eyup
Telerik team
 answered on 14 Oct 2020
2 answers
195 views

How can I populate this combobox with items from the controller onPage Load? The following is not working

 

<input id="CodeList" placeholder="Select" style="width: 100%;" />

<script>
    $(document).ready(function () {
        $("#CodeList").kendoComboBox({
            index: 0,
            dataTextField: "text",
            dataValueField: "value",
            filter: "contains",
            dataSource: {

                 transport: {

                        read: {

                            dataType: "json",

                            url: '@Url.Action("CompanyIDChanged", "Login")',

                         }

               }

            }
        });
    });
</script>

 

Controller:

Function LoanCodeCombo() As ActionResult
            Dim CodeList= New LoginModel With {.Items = {
                New SelectListItem() With {.Text = ""},
                New SelectListItem() With {.Text = "A"},
                New SelectListItem() With {.Text = "B"},
                New SelectListItem() With {.Text = "C"},
                New SelectListItem() With {.Text = "S"},
                New SelectListItem() With {.Text = "T"},
                New SelectListItem() With {.Text = "U"},
                New SelectListItem() With {.Text = "7"},
                New SelectListItem() With {.Text = "8"},
                New SelectListItem() With {.Text = "9"},
                New SelectListItem() With {.Text = "0"}
                }
            }
            Return Json(CodeList, JsonRequestBehavior.AllowGet)
        End Function

Joshua
Top achievements
Rank 1
Veteran
 answered on 14 Oct 2020
2 answers
83 views

I posted a similar question before but I'll try to be as clear as possible this time. I created a template for my "DealerAddressStreet" field.

{
    field: "DealerAddressStreet",
    title: "Address",
    sortable: false,
    width: "140px",
    editor: googleAutoComplete
},

 

This is my template which creates a text input that calls a JS function called "initAutocomplete()". 

function googleAutoComplete(container, options) {
    var input = $('<input id="Dynamic_DealerAddressStreet" type="text" class="k-textbox" name="DealerAddressStreet" data-bind="value:DealerAddressStreet" onfocus="initAutocomplete()">');
    input.appendTo(container);
}

 

The JS function gets the user's location and provides autocomplete for the address typed in. It also inserts the values into the address text inputs without the user having to type them in manually.

function initAutocomplete() {
    console.log('Function executed...');
    autocomplete = new google.maps.places.Autocomplete(
        document.getElementById("Dynamic_DealerAddressStreet"),
        { types: ["geocode"] }
    );
    autocomplete.setFields(["address_component"]);
    autocomplete.addListener("place_changed", fillInAddress);
}
 
function fillInAddress() {
    const place = autocomplete.getPlace();
 
    var tbAddress = $('#DealerAddressStreet');
    var tbCity = $('#DealerAddressCity');
    var tbState = $('#DealerAddressState');
    var tbZip = $('#DealerAddressZip');
 
    var address = place.address_components[0].short_name + ' ' + place.address_components[1].short_name;
    var city = place.address_components[2].short_name;
    var state = place.address_components[4].short_name;
    var zipcode = place.address_components[6].short_name;
    //var country = place.address_components[5].short_name
 
    // Set input values
    tbAddress.attr('value', address);
    tbCity.attr('value', city);
    tbState.attr('value', state);
    tbZip.attr('value', zipcode);
 
    tbAddress.val(address);
    tbCity.val(city);
    tbState.val(state);
    tbZip.val(zipcode);
}

 

The problem is that the new text input values are NOT being read when UPDATING or CREATING a new record if the values are inserted dynamically through my script. How can this issue be resolved?

Eric
Top achievements
Rank 1
 answered on 13 Oct 2020
2 answers
112 views
I'm trying to assign a value to 4 separate text inputs using jQuery inside of my Kendo Grid. My JS function works and the text inputs do populate with data but when I try creating a new record the data appears to not be bound when passed back to my Web API. 
Tsvetomir
Telerik team
 answered on 13 Oct 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?