* (mostly a wrapper that binds jeditable features with the ajax api and replies on crm-entity crmf-{field} html conventions)
* if you want to add an edit in place on a template:
* - add a class crm-entity and id {EntityName}-{Entityid} higher in the dom
* (mostly a wrapper that binds jeditable features with the ajax api and replies on crm-entity crmf-{field} html conventions)
* if you want to add an edit in place on a template:
* - add a class crm-entity and id {EntityName}-{Entityid} higher in the dom
// param in : a dom object that contains the field name as a class crmf-xxx
var getFieldName = function (field) {
if ($(field).data('field')) {
// param in : a dom object that contains the field name as a class crmf-xxx
var getFieldName = function (field) {
if ($(field).data('field')) {
var fieldName=field.className.match(/crmf-(\S*)/)[1];
if (!fieldName) {
console && console.log && console.log("Couldn't get the crm-editable field name to modify. You need to set crmf-{field_name} or data-{field_name}");
var fieldName=field.className.match(/crmf-(\S*)/)[1];
if (!fieldName) {
console && console.log && console.log("Couldn't get the crm-editable field name to modify. You need to set crmf-{field_name} or data-{field_name}");
console && console.log && console.log("Couldn't get the entity id. You need to set class='crm-entity' id='{entityName}-{id}'");
formSettings.entity=e[1];
formSettings.id=e[2];
console && console.log && console.log("Couldn't get the entity id. You need to set class='crm-entity' id='{entityName}-{id}'");
formSettings.entity=e[1];
formSettings.id=e[2];
if ($i.hasClass('crm-dialog')) {
$i.click (function () {
var $n=$('<div>Loading</div>').appendTo('body');
$n.dialog ({modal:true,width:500});
$n.crmForm (formSettings);
if ($i.hasClass('crm-dialog')) {
$i.click (function () {
var $n=$('<div>Loading</div>').appendTo('body');
$n.dialog ({modal:true,width:500});
$n.crmForm (formSettings);