unable to filter in auto filter box in second grid tab

Questionsunable to filter in auto filter box in second grid tab
Man Lam asked 9 years ago

I found that date picker did'nt work in auto filter box in second grid tab. when i click the date, the date can't display in the auto filter box in both second and third grid tab, but it is okay in the first grid.

5 Answers
Abu Ghufran answered 9 years ago

You will need little fix in lib/inc/jqgrid_dist.php

In: function link_date_picker(el,fmt,toolbar,opts), comment out the if (…) return line.

// dont show dateicon if readonly or hidden
// if (jQuery(el).is(":hidden")) return; <——————–

Basically, it was added to avoid binding datepicker with hidden elements.
And in unfocussed tab, it is also treated as hidden.

Abu Ghufran answered 9 years ago

I've emailed you updated build, kindly override and apply the fix that i sent earlier.

Fix was:

In: function link_date_picker(el,fmt,toolbar,opts), comment out the if (…) return line.
// dont show dateicon if readonly or hidden
// if (jQuery(el).is(":hidden")) return; <——————–

Man Lam answered 9 years ago

I can't find the "if (jQuery(el).is(":hidden")) return;" in the lib/inc/jqgrid_dist.php

function link_date_picker(el,fmt,toolbar,opts)
{
toolbar = toolbar || 0;
setTimeout(function(){
if(jQuery.ui)
{
if(jQuery.ui.datepicker)
{
opts = (typeof(opts) == 'undefined') ? {} : opts;

if (toolbar == 0)
{
if (!jQuery.browser.msie && !jQuery("link[href$='ui.bootstrap.jqgrid.css']").length)
jQuery(el).css('width',parseInt(jQuery(el).css('width'))-30);
else
jQuery(el).css('width','75%');

jQuery(el).after(' <button>Calendar</button>').next().button({icons:{primary: 'ui-icon-calendar'}, text:false}).css({'font-size':'69%', 'margin-left':'2px'}).click(function(e){jQuery(el).datepicker('show');return false;});
}
jQuery(el).datepicker(
jQuery.extend(
{
"disabled":false,
"dateFormat":fmt,
"changeMonth": false,
"changeYear": false,
"firstDay": 1,
"onSelect": function (dateText, inst)
{
if (toolbar)
{
setTimeout(function () {
jQuery("#<?php echo $grid_id?>")[0].triggerToolbar();
}, 50);
}
jQuery(el).trigger('change');
}
},opts)
);

// if not bootstrap
if (!jQuery("link[href$='ui.bootstrap.jqgrid.css']").length)
jQuery('.ui-datepicker').css({'font-size':'69%'});
}
}
},300);
}

Man Lam answered 9 years ago

after override the file and comment out, the problem is still existed. also, the date picker can't in third tab grid and time picker can't show in second and third tab grid. pls kindly fix.

Abu Ghufran answered 9 years ago

You can apply same fix in function link_datetime_picker()

// dont show dateicon if readonly or hidden
// if (jQuery(el).is(":hidden")) return; <——————–

Please email grid code for review, and if online share the link.

Your Answer

3 + 17 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?