[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15348]
From: |
nelson . guerra |
Subject: |
[Fmsystem-commits] [15348] |
Date: |
Wed, 29 Jun 2016 01:10:53 +0000 (UTC) |
Revision: 15348
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15348
Author: nelson224
Date: 2016-06-29 01:10:52 +0000 (Wed, 29 Jun 2016)
Log Message:
-----------
Added Paths:
-----------
branches/dev-syncromind-2/property/js/portico/import_components.js
Copied: branches/dev-syncromind-2/property/js/portico/import_components.js
(from rev 15346,
branches/dev-syncromind-2/property/js/portico/generic_document.edit.js)
===================================================================
--- branches/dev-syncromind-2/property/js/portico/import_components.js
(rev 0)
+++ branches/dev-syncromind-2/property/js/portico/import_components.js
2016-06-29 01:10:52 UTC (rev 15348)
@@ -0,0 +1,103 @@
+
+$(document).ready(function ()
+{
+ $('select#type_id').change( function()
+ {
+ var oArgs1 = {menuaction:
'property.uigeneric_document.get_categories_for_type'};
+ var requestUrl = phpGWLink('index.php', oArgs1, true);
+ var data = {"type_id": $(this).val()};
+ JqueryPortico.execute_ajax(requestUrl,
+ function(result){
+ var $el = $("#cat_location_id");
+ $el.empty();
+ $.each(result, function(key, value) {
+
$el.append($("<option></option>").attr("value", value.id).text(value.name));
+ });
+ getLocations();
+ }, data, "GET", "json"
+ );
+ });
+
+ $('select#cat_location_id').change( function()
+ {
+ getLocations();
+ });
+
+ $('select#district_id').change( function()
+ {
+ var oArgs1 = {menuaction:
'property.uigeneric_document.get_part_of_town'};
+ var requestUrl = phpGWLink('index.php', oArgs1, true);
+ var data = {"district_id": $(this).val()};
+ JqueryPortico.execute_ajax(requestUrl,
+ function(result){
+ var $el = $("#part_of_town_id");
+ $el.empty();
+ $.each(result, function(key, value) {
+
$el.append($("<option></option>").attr("value", value.id).text(value.name));
+ });
+ getLocations();
+ }, data, "GET", "json"
+ );
+ });
+
+ $('select#part_of_town_id').change( function()
+ {
+ getLocations();
+ });
+
+ $('select#part_of_town_id').prop('selectedIndex', 0);
+
+ var api = oTable0.api();
+ $('#datatable-container_0 tbody').on( 'click', 'tr', function ()
+ {
+ if ( $(this).hasClass('selected') )
+ {
+ var selected = api.rows(this).data()[0];
+ //console.log(selected.location_code);
+ $('#tab-content').responsiveTabs('enable', 1);
+ $('#tab-content').responsiveTabs('activate', 1);
+ $('#location_name').html(selected.location_code + ' ' +
selected.loc1_name);
+ $('#location_code').val(selected.location_code);
+ } else {
+ $('#tab-content').responsiveTabs('deactivate', 1);
+ $('#tab-content').responsiveTabs('disable', 1);
+ $('#location_name').html('');
+ $('#location_code').val('');
+ }
+ });
+
+});
+
+function getLocations()
+{
+ paramsTable0['type_id'] = $('#type_id').val();
+ paramsTable0['cat_id'] = $('#cat_location_id').val();
+ paramsTable0['district_id'] = $('#district_id').val();
+ paramsTable0['part_of_town_id'] = $('#part_of_town_id').val();
+
+ $('#tab-content').responsiveTabs('deactivate', 1);
+ $('#tab-content').responsiveTabs('disable', 1);
+ $('#location_name').html('');
+ $('#location_code').val('');
+
+ oTable0.fnDraw();
+}
+
+
+ /*
+this.local_DrawCallback1 = function (oTable)
+{
+ var api = oTable.api();
+
+ api.$('tr').click( function ()
+ {
+ if ( $(this).hasClass('selected') ) {
+ var selected = api.rows(this).data()[0];
+ console.log(selected.location_code);
+ $('#tab-content').responsiveTabs('activate', 1);
+ $(this).addClass('selected row_selected');
+ }
+
+ });
+};
+*/
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15348],
nelson . guerra <=