in-line search

Questionsin-line search
Andy asked 12 years ago

does not work in-line search with complex queries, in what could be the problem. Help please.

10 Answers
Abu Ghufran answered 12 years ago

If you send me the query, i can check similar scenario. Ideally it should work with all types.

Andy answered 12 years ago

My sql query:
$g->select_command = "SELECT shop.id as id,category.name as category,subcategory.name as subcategory,types.name as types, shop.name as name,shop.comments,coalesce(concat('../img_shop/',shop.image),'img/no.png') as image,shop.edit,shop.status, shop.count,shop.article,shop.price_opt,price_roz FROM shop
LEFT OUTER join category on category.id=shop.category
LEFT OUTER join subcategory on subcategory.id=shop.subcategory
LEFT OUTER join types on types.id=shop.types
This problem is all the fields even if the data are taken from Glan table, for me the real problem is to find the fields:
category
subcategory
types
name
article
And another question, how to make a linked list, the second list should be dependent on the former, for example, I was trying to pass the value of the first list but the result of this is not present, for example my query:
$res_act=mysql_query("select id as k, name as v, from subcategory where status=1 and subcategory.id='{category}' ");
Excuse me for my english, I'm from Russia.

Andy answered 12 years ago

if the request is done through selection box then select a nested search is necessary to enter but id record.
Help please

thamothar answered 12 years ago

hi,

i am search inline the grid.but i was using filter_search($data).in this function when i displayed YES and NO instead of both table id are equal or not..how to search in this case

thanks..

Abu Ghufran answered 12 years ago

Hello Andy,

For Case1,

$col = array();
$col["title"] = "Client";
$col["name"] = "cname";
$col["dbname"] = "clients.name"; // this is required as we need to search in name field, not id
….

Here "cname" is field alias, as you take in sql. But dbname param will define exact "table.field" to be used in WHERE clause for searching. Probably for joined tables, you need to define "dbname" param for all such cases.

For Case2,

I would recommend to refer example master-detail.php. It has working code how to make list dependent.

Regards,

Abu Ghufran answered 12 years ago

Also, please explain "request is done through selection box " with some screenshot example.
email me details at [email protected]

Andy answered 12 years ago

it works, thanks a lot. But how to make that search was on like and did not consider the case (upper or lower case)

Abu Ghufran answered 12 years ago

In core lib jqgrid_dist.php,

search
jQuery("#<?php echo $grid_id?>").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false});
replace with
jQuery("#<?php echo $grid_id?>").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false, defaultSearch:'cn'});

This will enable "contains" search in auto filter toolbar.

Andy answered 12 years ago

I did so, the search is on entry, but it is case sensitive, that is, the title does not equal line and no search is

Abu Ghufran answered 12 years ago

search
switch ($op) {

and add this case …
case 'cn' :
$qwery .= "LOWER($field)".$qopers[$op]." LOWER(".$v.")";
break;

It should work after that. You can also tweak by debugging the final sql, and checking thru firebug ajax response

Your Answer

12 + 4 =

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?