New home › Forums › Pro Add-on › order heading listing Column
- This topic has 21 replies, 1 voice, and was last updated 1 week, 1 day ago by Steven.
-
AuthorPosts
-
September 1, 2020 at 1:41 pm #60692maroParticipant
Hi,
I have reday a custom field but it is displayed at the end of the list
is it possible to modify the order of the list to have this field in the 2nd column ?
ThnaksSeptember 1, 2020 at 3:44 pm #60696[email protected]MemberHi there,
Thanks so much for getting in touch.
It is possible to change the order of custom fields from the custom field editor page (Maps > Custom Fields), by clicking and dragging the handler icon (three vertical bars) on the left side of each custom field.
You can drag these in the position you want them displayed and then save the settings to update it.Please let me know if this works as expected for you.
Thanks.
Best regards,
DylanSeptember 1, 2020 at 6:13 pm #60698maroParticipanthi Dylan,
i want to order the custome field whit the default fields like the titre , description etcSeptember 2, 2020 at 8:24 am #60707[email protected]MemberHi Maro,
Thanks for your response and for confirming.
This can be accomplished with some custom code, which I would be happy to help with.
In order to assist you with this further, could I kindly ask if you could send me a link to your map and confirm in which order you would like the columns to be displayed?
Thanks for your time.
Best regards,
DylanSeptember 2, 2020 at 1:16 pm #60712maroParticipantThis reply has been marked as private.September 3, 2020 at 8:32 am #60721[email protected]MemberHi there,
Thanks for the response and information.
Could I kindly ask you to install this custom plugin which re-orders the columns based on your order (title, custom field #7, address, description and link):
https://drive.google.com/file/d/1dKjj5oOV0GojFPs5QYpJY3njIHcXQbT0/view?usp=sharingOnce installed and activated, it should automatically re-order the columns accordingly.
Please let me know if this works as expected.
Thanks.
Kindest regards,
DylanSeptember 3, 2020 at 9:16 am #60723maroParticipantHi Daylan,
Thanks it ‘s work.
Kindest regards
MaroSeptember 3, 2020 at 9:16 am #60724[email protected]MemberHi Maro,
That is great to hear and it is only a pleasure.
Please let me know if there is ever anything else I can assist you with.
Kindest regards,
DylanSeptember 3, 2020 at 3:32 pm #60731maroParticipanthi,
I forgot to specify that the site will be multilingual afterwards.
I have modified the labels by js I don’t know what to do if I activate the multilingual.jQuery(function(){ jQuery(document.body).on("infowindowopen.wpgmza", function(e){ jQuery(".wpgmza-infowindow p").each(function(){ var customFieldTitle = jQuery(this).data("custom-field-name"); if(customFieldTitle){ jQuery(this).html("" + customFieldTitle + ": " + jQuery(this).text()); } }); }); jQuery(document).ready(function(){ jQuery("#wpgmza_marker_holder_3 th:nth-child(2)").text("Patron(s)"); jQuery("#wpgmza_marker_holder_3 th:nth-child(5)").text("Contact"); jQuery("#wpgmza_marker_holder_3 th:nth-child(6)").text("Fiche fabricant"); }); });
September 4, 2020 at 9:31 am #60745[email protected]MemberHi Maro,
Thanks for the response and letting me know.
The language can be determined by this line of JavaScript:
var lang = jQuery(‘html’).attr(‘lang’);Then the code that changes the labels can be changed to the below in order to set the labels according to the language:
jQuery(document).ready(function(){
var lang = jQuery(‘html’).attr(‘lang’);
var titleLabel = “Patron(s)”;
var contactLabel = “Contact”;
var linkLabel = “Fiche fabricant”;if (lang == ‘fr-FR’) {
titleLabel = “French title”;
contactLabel = “French contact”;
linkLabel = “French link”;
} else if (lang == ‘es-ES’) {
titleLabel = “Spanish title”;
contactLabel = “Spanish contact”;
linkLabel = “Spanish link”;
}
jQuery(“#wpgmza_marker_holder_3 th:nth-child(2)”).text(titleLabel);
jQuery(“#wpgmza_marker_holder_3 th:nth-child(5)”).text(contactLabel);
jQuery(“#wpgmza_marker_holder_3 th:nth-child(6)”).text(linkLabel);
});I hope this helps and please let me know if it works as expected.
Thanks.
Kindest regards,
DylanSeptember 8, 2020 at 11:28 am #60767maroParticipanthi,
i have changed text “more detial” in infoswindows, but i cant change it in the table.
ThanksSeptember 9, 2020 at 7:40 am #60775[email protected]MemberHi Maro,
Thanks for letting me know.
Because this content is dynamically loaded and refreshed, it will require different code, which I have prepared below:
jQuery(document).ready(function(){
var parent = WPGMZA.AdvancedTableDataTable.prototype.getDataTableSettings;
WPGMZA.AdvancedTableDataTable.prototype.getDataTableSettings = function()
{
var settings = parent.apply(this, arguments);
settings.columnDefs = [
{
“render”: function ( data, type, row ) {
var label = ‘More details text’;
return ” + label + ”;
},
“targets”: 5
},
];
return settings;
}
});Could I kindly ask you to add the code above, setting the ‘More details text’ text to your required text?
Please let me know if this helps as expected.
Thanks again for your time.
Best regards,
DylanSeptember 9, 2020 at 9:04 am #60776maroParticipantthanks,
i have erreur in this line :var settings = parent.apply(this, arguments);
Uncaught TypeError: parent.apply is not a function
September 9, 2020 at 9:19 am #60777maroParticipant[quote quote=60776]thanks,
i have erreur in this line :var settings = parent.apply(this, arguments);
Uncaught TypeError: parent.apply is not a function
[/quote]
it work but
my content is like this:
<td class="wpgmza_table_link"><a target="_BLANK" href="http://preprod.charcuterie-vaudoise.ch/boucherie-du-chateau-et-chateaubriand-a-morges/">More Details</a></td>
know i have only the lable :”+ label + ” without and if i dont have data in column, it show the labelSeptember 9, 2020 at 9:53 am #60778maroParticipanti have add condition for check if the row have content or not befor edit the label “more detail”
if (row[5].length == 0){ return data; }else{ return data +' ('+ labelMore +')'; }
-
AuthorPosts
- You must be logged in to reply to this topic.