/    Sign up×
Community /Pin to ProfileBookmark

Sorting Columns

I’m not really sure if this is the correct forum for this message. If not. Could the mods please move.

I’m not sure if this is the cause. but as far as I can tell, this sort was working when the table was a real table. But after I asked a developer to make all my pages tableless. It doesn’t work anymore.

You can see the action on this page [url]http://EliteDoms.com/portfolio.php[/url]. The Sort Columns should work only when domains are listed (including all) but let’s just take a small subset and select Air-con category and press search. It lists all the domains in the Air-con category, sorting by default on the Domain alphabetically. So far so good.

But now when I click on any column heading, including Domain, it is supposed to sort the table by that column. But instead of this, it presents this search: [B]SEARCH TEXT: a IN CATEGORY: ALL[/B]. I’ve studied both the html and css until I’m blue in the face, but cannot find any reference to this search. which is why I need some help.

I’m not an expert with CSS. I would probably call my experience somewhere between novice and knowing the basic structure/rules. But anything above that level it gets difficult for me to follow somebody else’s coding. So it’s a bit difficult for me to identify the precise code doing this. Hence no code has been quoted, at this point.

Could somebody please go to the website and perform the actions above. Look at the code. And suggest corrections which might resolve this problem. thank you.

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@SempervivumMar 08.2017 — But after I asked a developer to make all my pages tableless.[/QUOTE]Why this? The data in your link is tabular and should be displayed by a tabular markup. It's true that tables should not be abused for layout purposes but this doesn't apply for the data in your link.
Copy linkTweet thisAlerts:
@stubauthorMar 09.2017 — Why this? The data in your link is tabular and should be displayed by a tabular markup. It's true that tables should not be abused for layout purposes but this doesn't apply for the data in your link.[/QUOTE]

Yeah! I'm only just learning this. But does it do any harm, not to use regular tables for this? I appreciate your comments. they are all welcome. But it doesn't exactly get to the root of the problem.

I've been studying the code even more than before. In the hopeless task of finding the problem. My latest theory (developed just before sleeping last night) is it probably is not the HTML or CSS but in the Javascript at the bottom of the page. I only saw this late last night as the possible cause of the problem. I'm going to investigate that further today. But if anyone is looking at this problem, and could confirm that. It would be appreciated.
Copy linkTweet thisAlerts:
@stubauthorMar 09.2017 — I'm more and more thinking the problem is with the javascript. Stemming from the script at the bottom of the search.php page

<script type="text/javascript">
$('.show_all_category').on('click',function(){
window.location.href ="./search.php?show=all";
$('#serachbar_show_popup').modal('hide');
});
$('.btn-focus').on('click',function(){
$('.data_show').hide();
//window.location.href ="./portfolio.php";
});
</script>


Which turns into this after clicking a column and viewing the page source (with the faulty all domains listed). It appears immediately after the first long list of domain categories.

<input type="text" class="form-control" id="serch_input_box" name="query" placeholder="Search...">
<script type="text/javascript">
$('#serch_input_box').val('a');
</script>
<span class="input-group-btn">
<button type="submit" class="btn btn-global-search btn-lg btn-default"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> Search</button>
</span>


As far as I can tell. The screwy spelling has been coded correctly (done by my developer, not me). But I won't correct that until I understand this problem fully. There are a few mispellings like that. But see the .val('a'); That's the 'a' being searched with the bad results. I still haven't figured out how it goes from the 1st code box and ends un in the 2nd code box like this.

Then there is the modal script, which seems to be controlling all of this. In the same source code quoted above it shows this

<script type="text/javascript">
$('.show_all_category').on('click',function(){
window.location.href ="./search.php?show=all";
$('#serachbar_show_popup').modal('hide');
});
$('.btn-focus').on('click',function(){
$('.data_show').hide();
//window.location.href ="./portfolio.php";
});
</script>


And in searchbar.php it looks like this

[code<div class="modal fade" id="serachbar_show_popup" tabindex="-1" role="dialog">

<div class="modal-dialog">

<div class="modal-content">

<div class="modal-header">

<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>

<h4 class="modal-title">Warning !</h4>

</div>

<div class="modal-body">

<p>Do you really want to list every domain ?</p>

</div>

<div class="modal-footer">

<a href="javascript:;" class="btn btn-default show_all_category">Yes</a>

<a href="javascript:;" class="btn btn-primary btn-focus" data-dismiss="modal" >No</a>

</div>

</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->

</div><!-- /.modal -->

<script>

function validate_form(){

console.log('in function');

var search_str = $('#serch_input_box').val();

var category = $('#select_category').val();

if(category==0 && !search_str){

console.log('in if');

$('#serachbar_show_popup').modal('show');

return false;

}

else{

console.log('in else');

return true;

}

}

function mob_validate_form(){

console.log('in function');

var search_str = $('#mob_serch_input_box').val();

var category = $('#mob_select_category').val();

if(category==0 && !search_str){

console.log('in if');

$('#serachbar_show_popup').modal('show');

return false;

}

else{

console.log('in else');

return true;

}

}


</script>[/code]

I really do not have much comprehension of what all this is doing. Except it looks like a Javascript problem rather than a CSS problem. I think the problem might be resolved by when clicking on the column, and instead of entering a value of 'a' it was entering the value for each "column title" instead. But, I don't know much.
Copy linkTweet thisAlerts:
@SempervivumMar 10.2017 — But now when I click on any column heading, including Domain, it is supposed to sort the table by that column.[/QUOTE]There are libraries for making tables sortable, e. g. this:

http://tablesorter.com/docs/

However these requiere a table markup. I recommend going back to table and use such library.
Copy linkTweet thisAlerts:
@stubauthorMar 12.2017 — OK. I think you can close this thread. I'm getting this fixed via fiverr.
Copy linkTweet thisAlerts:
@jedaisoulMar 12.2017 — Moral of the story: If it ain't broke, don't fix it. ?

Thread closed.
×

Success!

Help @stub spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...