Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Paste Mode #8050

Open
kendo-bot opened this issue Nov 18, 2024 · 0 comments
Open

Default Paste Mode #8050

kendo-bot opened this issue Nov 18, 2024 · 0 comments
Labels
C: Grid Enhancement FP: Unplanned Sync status with associated Feedback Item jQuery

Comments

@kendo-bot
Copy link
Contributor

kendo-bot commented Nov 18, 2024

By default, when the "paste" command is added, the default option is "insert" mode ("Paste (Insert)"). Is it possible to add an option that allows setting the default paste mode to "replace" ("Paste (Replace)")?

For example:

$("#grid").kendoGrid({
       toolbar: ["paste"],
       allowPaste: {
         default: "replace"
       },
       ...
});

Workaround

  • Handle the "dataBound" event of the Grid and get a reference to the Toolbar DropDownList.
  • Use the data() method of the DropDownList's DataSource to set only the "replace" option.
  • Call the value() method to update the default pasting option.
<script>
function onDataBound() {
    var ddl = $(".k-grid-paste-action[data-role='dropdownlist']").getKendoDropDownList();
    ddl.dataSource.data([{text: "Paste (Replace)", value: "replace"}]);
    ddl.value("replace");
}
</script>

@kendo-bot kendo-bot added the FP: Unplanned Sync status with associated Feedback Item label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Grid Enhancement FP: Unplanned Sync status with associated Feedback Item jQuery
Projects
None yet
Development

No branches or pull requests

2 participants