Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery - how to attach event to DOM object and bind a handler to it in distinct places?
    primarykey
    data
    text
    <p>I have a small web-app - it contain table. Data in cells may have multiple types, and for some types user must be able to define its own 'editor' - for date - jQuery date-picker for example. Idea is to give user ability to write custom callbacks which will serve editing of cells.</p> <p>The problem is in retrieving data after process of editing:<br> For example - cell with date data. User clicking on it, chooses date with datepicker, and then leave this cell, which cause 'blur' event. And this must cause:<br> - Returning cell to its initial look<br> - Retrieving data from 'editor' and putting it to the cell</p> <p>Retrieved data must be stored in internal data-structure (Backbone model). And I dont want to give access to it to custom user-made callback. I thought that user could return an event object <em>binded</em> to <code>input</code> or <code>textarea</code> whatever tag his editor will use, and his own handler for it which will return cell to initial state and return value that must be saved into internal data structure and showed in <code>&lt;td/&gt;</code> tag.</p> <p>And so my question is - how to bind an event to object and pass it to other function that will attach proper handler to it?</p> <p>ps<br> For now I decied to solve this problem by passing to user-made callback an object with special event attached to it, which user must trigger in his 'blur' handler and pass retrieved value from editor as <a href="http://api.jquery.com/event.data/" rel="nofollow">event.data</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload