Question

I have this code for my schema:

schema: {
                model: {
                    fields: {
                        col1: {
                            type: "string", editable: true, nullable: false,
                            validation:{ required: { message: "Name is Required." } }
                        },
                        col2: {
                            type: "string", editable: true, nullable: false,
                            validation:{ required: { message: "Please Select a Main Language." } }
                        },
                        col3:{
                            type: "Array[]", editable: true, nullable: false,
                            validation:{ required: { message: "Please Select Supported Language(s)." } }
                        },
                        col4: {
                            type: "string", editable: false, nullable: true
                        },
                        col5: {
                            type: "string", editable: false, nullable: true
                        }
                    }
                }
            }

Columns code snippet

{
                    field: "col4",
                    title: "Column4",
                    width:"200px",
                    editable:false,
                    nullable: true
                },
                {
                    field: "col5",
                    title: "Column5",
                    width:"200px",
                    editable:false,
                    nullable: true
                }

I would like to disable the last two (status and unlocalized count). As you can see I have already used the editable and nullable. My goal is to send an HTTP post without the two which has this JSON format

{"col1":"string", "col2":"string","col3":["string"]}
Was it helpful?

Solution

UPDATE: I used a editor that has a function.

function(container){

  $('label[for=status]').parent().remove();

}

which looks like this now

{
  field: "status",
  title: "Status",
  editable:false,
  editor:function(container){
                       $('label[for=status]').parent().remove();
                   }
}

OTHER TIPS

The Kendo way to do it would be to add field called Edit in the kendoGridSource like so:

edit: function (e) {
           e.container.find('[for="none"]').parent().remove();
           e.container.find('[data-container-for="none"]').remove();
 },

In there you would look for the fields the that have for="none" and remove all of them, same would go for the container.

Then in your schema, The field you want to edit out:

{
  field: "none",
  title: "Column5",
  width:"200px",
},
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top