www.dextsolution.com
DEXTUPLOAD
X5
Reference > Events

onDX5BeforeItemsDelete

- Version 1.0.0.0 or later

- Explanation

  The onDX5BeforeItemsDelete function is a callback function that is called before deleting items.

  If the return value of the function is true or undefined, the deletion continues. On the other hand, if you explicitly return a false value, subsequent deletions are canceled.

      function onDX5BeforeItemsDelete(id, arr) {
          return confirm("Do you want to delete " + arr.length + " item(s)?");
      }

- Uses

      # Declare event handlers globally
      function onDX5BeforeItemsDelete(id, arr) {
          ...
          return true; // or false
      }

      # Register event handlers at component creation time (3.10.0.0 version or later)
      dx5.create({
          ...
          events: {
              beforeItemsDelete: function(id, arr) {
                  ...
                  return true; // or false
              }
          }
      });

- Parameters

  Name | Type | Explanation
  --- | --- | ---
  id | String | The component id of the event
  arr | Array | An array of unique id(s)

- Return

  true, false

onDX5ItemDeleting

- Version 1.0.0.0 or later

- Explanation

  The onDX5ItemDeleting function is a callback function that is called before deleting an individual item.

  If the return value of the function is true or undefined, the deletion continues. On the other hand, if you explicitly return a false value, subsequent deletions are canceled.

      function onDX5ItemDeleting(id, itemId) {
          var item = dx5.get(id).getItemById(itemId);
          return confirm("Do you want to delete " + item.name + " item?");
      }

- Uses

      # Declare event handlers globally
      function onDX5ItemDeleting(id, itemId) {
          ...
          return true; // or false
      }

      # Register event handlers at component creation time (3.10.0.0 version or later)
      dx5.create({
          ...
          events: {
              itemDeleting: function(id, itemId) {
                  ...
                  return true; // or false
              }
          }
      });

- Parameters

  Name | Type | Explanation
  --- | --- | ---
  id | String | The component id of the event
  itemId | String | Unique ID of the item

- Return

  true, false

onDX5ItemsDeleted

- Version 1.0.0.0 or later

- Explanation

  The onDX5ItemsDeleted function is a callback function that is called after deleting job is completed.

      function onDX5ItemsDeleted(id, count) {
          alert(count + " item(s) deleted.");
      }

- Uses

      # Declare event handlers globally
      function onDX5ItemsDeleted(id, count) { ... }

      # Register event handlers at component creation time (3.10.0.0 version or later)
      dx5.create({
          ...
          events: {
              itemsDeleted: function(id, count) { ... }
          }
      });

- Parameters

  Name | Type | Explanation
  --- | --- | ---
  id | String | The component id of the event
  count | Number | Number of deleted items