fileBrowser.schema.model.fieldsObject

Defines the field mappings for the file browser data model. This configuration specifies which fields in the server response contain the name, type, and size information for files and directories. The fields object allows you to map the server data structure to the expected properties that the file browser uses to display and manage files. Each field can be configured as either a string (field name) or an object with additional parsing options.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    tools: ["createLink"],
    fileBrowser: {
        schema: {
            model: {
                fields: {
                    name: "Name",
                    type: "Type",
                    size: "Size"
                }
            }
        }
    }
});
</script>

fileBrowser.schema.model.fields.nameObject|String

The field which contains the name of the file/directory

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    tools: ["createLink"],
    fileBrowser: {
        schema: {
            model: {
                fields: {
                    name: { field: "FileName" }
                }
            }
        }
    }
});
</script>

fileBrowser.schema.model.fields.name.fieldString

The name of the field.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    tools: ["createLink"],
    fileBrowser: {
        schema: {
            model: {
                fields: {
                    name: { field: "FileName" }
                }
            }
        }
    }
});
</script>

fileBrowser.schema.model.fields.name.parseFunction

Specifies the function which will parse the field value. If not set default parsers will be used.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    tools: ["createLink"],
    fileBrowser: {
        schema: {
            model: {
                fields: {
                    name: { 
                        field: "FileName",
                        parse: function(value) {
                            return value.toString();
                        }
                    }
                }
            }
        }
    }
});
</script>

fileBrowser.schema.model.fields.typeObject|String

The field which contains the type of the entry. Either f for file or d for directory.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    tools: ["createLink"],
    fileBrowser: {
        schema: {
            model: {
                fields: {
                    type: { field: "Type" }
                }
            }
        }
    }
});
</script>

fileBrowser.schema.model.fields.type.parseFunction

Specifies the function which will parse the field value. If not set default parsers will be used.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    tools: ["createLink"],
    fileBrowser: {
        schema: {
            model: {
                fields: {
                    type: { 
                        field: "Type",
                        parse: function(value) {
                            return value === "directory" ? "d" : "f";
                        }
                    }
                }
            }
        }
    }
});
</script>

fileBrowser.schema.model.fields.type.fieldString

The name of the field.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    tools: ["createLink"],
    fileBrowser: {
        schema: {
            model: {
                fields: {
                    type: { field: "EntryType" }
                }
            }
        }
    }
});
</script>

fileBrowser.schema.model.fields.sizeObject|String

The field which contains the size of file.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    tools: ["createLink"],
    fileBrowser: {
        schema: {
            model: {
                fields: {
                    size: { field: "Size" }
                }
            }
        }
    }
});
</script>

fileBrowser.schema.model.fields.size.fieldString

The name of the field.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    tools: ["createLink"],
    fileBrowser: {
        schema: {
            model: {
                fields: {
                    size: { field: "FileSize" }
                }
            }
        }
    }
});
</script>

fileBrowser.schema.model.fields.size.parseFunction

Specifies the function which will parse the field value. If not set default parsers will be used.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    tools: ["createLink"],
    fileBrowser: {
        schema: {
            model: {
                fields: {
                    size: { 
                        field: "FileSize",
                        parse: function(value) {
                            return parseInt(value);
                        }
                    }
                }
            }
        }
    }
});
</script>