editable field not working in column Grid

2 Answers 18 Views
Grid
bahaso
Top achievements
Rank 1
Iron
Iron
Iron
bahaso asked on 02 Jul 2021, 12:57 PM

Hi,

 

I have following code, and i could editable field marked as editable: false ?

Why regards

            <div kendo-grid="mygrid"
                             class="customTransBg"
                             uib-collapse="hideDifference"
                             k-data-source="mygridDatasource"
                             k-sortable="true"
                             k-editable="true"
                             k-pageable="true"
                             k-filterable="{mode: 'row'}"
                             k-columns='[
                                {field: "source.<spring:message code="global.description"/>",
                                    title:"<spring:message code="rapport.etatcompte.erreurs.colonne.source"/>",
                                    filterable: filteringConfig, editable: false},
                                {field: "compte", title:"<spring:message code="rapport.etatcompte.errors.colonne.compte"/>",
                                    filterable: filteringConfig, "editable": false},
                                {field: "date",title: "<spring:message code="rapport.etatcompte.errors.colonne.date"/>", editable: false,
                                    filterable: filteringConfig},
                                {field: "facture", editable: false,title: "<spring:message code="rapport.etatcompte.errors.colonne.facture"/>",
                                    filterable: filteringConfig},
                                       {field: "total", title:"<spring:message code="rapport.etatcompte.errors.colonne.total"/>", editable: false,
                                    format:"{0:c}",
                                    filterable: filteringNumberConfig},
                                {field: "codeErreur",
                                    defaultValue: {id:" ",descriptionFr:" "},
                                   title: "<spring:message code="rapport.etatcompte.errors.colonne.codeErreur"/>", attributes: {"class": "k-item noCap"}, editor: codeErrorDropDownEditor, template: "#=codeErreur.<spring:message code="global.description"/>#", nullable: false}
                            ]'>
                        </div>

 

 

2 Answers, 1 is accepted

Sort by
0
bahaso
Top achievements
Rank 1
Iron
Iron
Iron
answered on 05 Jul 2021, 07:13 AM

OK solution is in datasource

Regards

0
Georgi Denchev
Telerik team
answered on 07 Jul 2021, 07:41 AM

Hello, Bahaso,

Yes, you are indeed correct.

You can set a field to be noneditable in the dataSource configuration:

var dataSource = new kendo.data.DataSource({
  schema: {
    model: {
      id: "ProductID",
      fields: {
        ProductID: {
          //this field will not be editable (default value is true)
          editable: false
        }
      }
    }
  }
});

Best Regards,
Georgi Denchev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
bahaso
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
bahaso
Top achievements
Rank 1
Iron
Iron
Iron
Georgi Denchev
Telerik team
Share this question
or