Guys, you are VERY smart !!!
What I'm looking for is SO simple in JQuery .. but .. I'm trying not to do things "my way", and share what I'm doing because I can't find it in the documentation, and I believe have to be something SUPER simple ...
LETs imagine I'm doing something similar to .. a quote system .. for example .. .. I will create an entity named "Quote", another one named "Items", and a last one named "Quote-Items" (to hold the many-to-many) ... then .. in the bottom of the Quote detail I will present a "quote-items" subpanel .. where the user can ADD/Update/Delete items (related to the quote) .. along with prices and so ..
if that's the case .. I will do something as simple as creating a file "detail.js"
I'm just looking for something .. as SIMPLE as that (getting "a" and "b" addressed) .. can anyone please, tell me .. if that SIMPLE thing can be done .. and HOW !???
thanks in advance ..
I will LOVE to be as smart as you guys are .. but .. I'm NOT .. I know how to "get around" using jquery .. but .. that solution is NOT the best, that's why I'm asking for help.
What I'm looking for is SO simple in JQuery .. but .. I'm trying not to do things "my way", and share what I'm doing because I can't find it in the documentation, and I believe have to be something SUPER simple ...
LETs imagine I'm doing something similar to .. a quote system .. for example .. .. I will create an entity named "Quote", another one named "Items", and a last one named "Quote-Items" (to hold the many-to-many) ... then .. in the bottom of the Quote detail I will present a "quote-items" subpanel .. where the user can ADD/Update/Delete items (related to the quote) .. along with prices and so ..
if that's the case .. I will do something as simple as creating a file "detail.js"
/home/espocrm/client/custom/src/views/quote/detail.js
Code:
define('custom:views/quote/detail', 'views/detail', function (Dep) { return Dep.extend({ setup: function() { ...... a--> this.listenTo( "... changes on the bottom-panel ... ??? ", function() { var total = 0; b--> this." get quote-items list from subpanel bellow ??? " .each( function( index, value ) { total += value.attribute.price * value.attribute.qty; }); this.model.set('total', total); this.model.save() .then(function() { //Cool beans .. Total updated !. }); }); } }) });
thanks in advance ..
I will LOVE to be as smart as you guys are .. but .. I'm NOT .. I know how to "get around" using jquery .. but .. that solution is NOT the best, that's why I'm asking for help.
Comment