1. #171
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    As a follow up on my post above I've noticed that it appears that query and fields always get inserted into the POST.

    I'm working from a perspective of the grid filters plugin where the POST is only populated from that plugin if it is active.

    To put it another way, I was checking if fields or query is NULL to know whether or not to have the query affected by the search plugin, but that is not working because query will evaluate to an empty string not null.

  2. #172
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Quote Originally Posted by mjlecomte View Post
    I was playing with this plugin and made an observation. I'm not sure if this is intended behavior or not.

    Go here: http://recordform.extjs.eu/

    On the search area click on the "X". I haven't explored the code to figure out what the intent is for that "X", but if you click on it right from the start it sends off an XHR.

    Also note that the FIELDS were posted as well. I noticed this when I was checking server side if $fields was null when I construct my WHERE query. So it threw me off when I cancelled the search (so I thought) by clicking on the 'X' in the search form, but the search (1) submitted a request to the server and (2) included the fields in the POST sent to the server, which would be of no use if there is no query term to use in the search (so it struck me as odd that the search form was adding to the POST when it wasn't being used per se).

    I wasn't sure if either of the above was expected behavior so I thought I'd mention it.
    X is not cancel but clear what means clear the the textbox and reload the grid. True is that request is not needed if field is already clear (=== ''). I've enclosed the logic in if and tested briefly - seems to work. It is not published yet.

    I also have two more comments which I'm reluctant even to mention, but will just in case it's of some use.

    I use MySQL so this may be different from you where this does not affect you. I noticed in some of your php files you construct and use $table or $field and '$value' (note the single quote only on value. In my situation I had a $field that happened to have a value of 'change'. MySQL didn't like that field not wrapped with either a single quote or a back tick (`).
    My real mySQL backend (never was and never will be published) looks different. PHP files in the examples are only-to-make-it-somehow-working to be able to demonstrate the functionality. I don't expect that users will take my files as they are and I do not provide any support for them whatsoever.

    The last observation with the php file was with regards to building the $fields and $values where you use array_walk and implode, etc. All of that is fine and great, but I had a situation where I had a column in my grid that was not in the database table (it was calculated elsewhere). In any event, my point is, I simply added a check to see if the $field was in_array($the_object_fields_that_you_set_up). So just a quick little check to make sure the query wasn't built using fields that were not in the database table.

    Again, these last two are rather application specific, but since I thought they could be generalized a bit I thought I'd point them out anyway.
    See my previous answer - real backend has all the bells and whistles, support for expressions, backticks, support for cross-database queries, auto generating data for combos, configuration objects save in table, generating column models for metaData configured grids and much more.

    I couldn't use it for examples as 1) I've decided that it will not be open source and 2) I wanted to give users ideas how the server side could work. (I doubt that they would study 10000+ lines of PHP code to find out that it finally sends out {success:true}).

    Therefore I've written all PHP scrips what you can see in examples as extra-extra lightweight from scratch.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  3. #173
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Quote Originally Posted by mjlecomte View Post
    As a follow up on my post above I've noticed that it appears that query and fields always get inserted into the POST.

    I'm working from a perspective of the grid filters plugin where the POST is only populated from that plugin if it is active.

    To put it another way, I was checking if fields or query is NULL to know whether or not to have the query affected by the search plugin, but that is not working because query will evaluate to an empty string not null.
    Empty query cancels the build of sql where clause server-side and fields array is information: If we're going to search, where to search?

    I real life I use mysql's rlike so I can type regular expressions. Also, I have some server-side operators recognition and handling for example: it recognizes the keyword null, >, <, = and ! operators, etc. Of course, these make sense only if you search in one field only.

    More complex filter is still to be written and it is beyond the scope of the purpose of this search plugin.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  4. #174
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Another observation of possibly unintended behavior:
    If you type "n" in the search field and the click search it will of course search on "n". If you click in the search field and delete "n", but then don't click on x or zoom icon then the post is not reset. I of course was doing this somewhat based on the prior comments where I didn't want to have a search submitted to the server.

    I can see why it works as it does. I just thought I'd make the remark in case you thought it should check the search field contents prior to searching.

  5. #175
    Ext User
    Join Date
    Nov 2007
    Location
    Chicago, IL
    Posts
    216
    Vote Rating
    0
    crpatrick is on a distinguished road

      0  

    Default


    Hi there-

    I noticed in the posts that for paged grids, the search must be done server side? Is there a way to search the store with the plugin using the local mode? I am actually streaming into a paging grid, and storing everything client side in a bufferedmemoryproxy. All is set to local, but within the paging grid, I can only ever search the current page (and since the data is streaming directly to the client, I can't do a server side sort unfortunately).

    Great job again on this!
    Chris

  6. #176
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by crpatrick View Post
    Hi there-

    I noticed in the posts that for paged grids, the search must be done server side? Is there a way to search the store with the plugin using the local mode? I am actually streaming into a paging grid, and storing everything client side in a bufferedmemoryproxy. All is set to local, but within the paging grid, I can only ever search the current page (and since the data is streaming directly to the client, I can't do a server side sort unfortunately).

    Great job again on this!
    Chris
    http://extjs.com/forum/showthread.ph...830#post111830

  7. #177
    Ext User
    Join Date
    Nov 2007
    Location
    Chicago, IL
    Posts
    216
    Vote Rating
    0
    crpatrick is on a distinguished road

      0  

    Default


    Hi there...I had read through that, but don't think that answers what I am looking for. I am already setting to local mode (remote isn't in the picture for my code). Not sure if I am missing something in that post though? Looked through again, and didn't see a reference to local mode/pagination with the bufferproxy.

    Hope all is well.
    Chris

  8. #178
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    grid.Search plugin has mode:'local' option that causes it filters local store. Take a look in the comments in source code; there is complete documentation of it. As to in-memory paging grids, I've never tried 'em - you're on your own here.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  9. #179
    Ext User
    Join Date
    May 2007
    Posts
    45
    Vote Rating
    0
    pantarhei is on a distinguished road

      0  

    Default


    thx a lot for this great plugin. works great! really nice.

    i have a question, though. how can i get the last query send to the server including the plugin params?

    if i look into the store.baseParams.lastOptions i can see only the baseParams of my store. looks like the query fileds and params are added dynamically. but i'd like to have the last params including the plugin params.

    hints?

    regards

  10. #180
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    I think that you need to listen to an event (perhaps beforeload) and you need to collect and remember parameters/options yourself.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


Thread Participants: 245

  1. franklt69 (5 Posts)
  2. galdaka (2 Posts)
  3. thameema (1 Post)
  4. Dumbledore (3 Posts)
  5. JeffBurr (1 Post)
  6. berend (1 Post)
  7. mystix (1 Post)
  8. salvi (1 Post)
  9. cobnet (1 Post)
  10. dawesi (2 Posts)
  11. mysticav (3 Posts)
  12. mike1993 (3 Posts)
  13. JorisA (1 Post)
  14. cricri (5 Posts)
  15. apaa (1 Post)
  16. mbstroz (5 Posts)
  17. notjoshing (1 Post)
  18. MeDavid (1 Post)
  19. AlxH (1 Post)
  20. pantarhei (5 Posts)
  21. DeeZ (3 Posts)
  22. NBRed5 (2 Posts)
  23. zoq (2 Posts)
  24. ajaxE (4 Posts)
  25. cmendez21 (1 Post)
  26. Ronaldo (1 Post)
  27. mjlecomte (25 Posts)
  28. smokeman (11 Posts)
  29. Nam (4 Posts)
  30. keithnlarsen (2 Posts)
  31. rednix (2 Posts)
  32. expertmo (4 Posts)
  33. cking (1 Post)
  34. jelt (4 Posts)
  35. bcamp1973 (2 Posts)
  36. grgur (2 Posts)
  37. dwt11 (1 Post)
  38. michiel (3 Posts)
  39. Shmoo (3 Posts)
  40. evilized (1 Post)
  41. fangstern (1 Post)
  42. vishalg (3 Posts)
  43. Strati (1 Post)
  44. ArtBuilders (6 Posts)
  45. dax (5 Posts)
  46. thatcoder (7 Posts)
  47. jcar98 (1 Post)
  48. derbbre (3 Posts)
  49. wm003 (1 Post)
  50. garraS (3 Posts)
  51. kenshin (1 Post)
  52. ByteLess (2 Posts)
  53. Lobos (1 Post)
  54. a4 (1 Post)
  55. durlabh (3 Posts)
  56. elDub (1 Post)
  57. rstuven (1 Post)
  58. crpatrick (4 Posts)
  59. zedisdead (1 Post)
  60. vector4711 (1 Post)
  61. oanimashaun (1 Post)
  62. donssmith (3 Posts)
  63. sanjshah (5 Posts)
  64. nielsendev (2 Posts)
  65. Jika (2 Posts)
  66. Cooldream (2 Posts)
  67. iTzAngel (1 Post)
  68. franck34 (2 Posts)
  69. paubach (2 Posts)
  70. stewart (1 Post)
  71. teknaut (4 Posts)
  72. pjesus (2 Posts)
  73. NotChris (5 Posts)
  74. juicymedia (2 Posts)
  75. v496820 (2 Posts)
  76. hazooma (1 Post)
  77. obbakilla (1 Post)
  78. BlueCamel (1 Post)
  79. feodor (1 Post)
  80. w3bbuilder (1 Post)
  81. johnsbrn (1 Post)
  82. razor (1 Post)
  83. seppy (3 Posts)
  84. stefanorg (3 Posts)
  85. jimkan (1 Post)
  86. kenja (2 Posts)
  87. sandy (1 Post)
  88. eri.TsingTao (1 Post)
  89. rainydays (1 Post)
  90. iLiketoGrid (1 Post)
  91. Shaguar (8 Posts)
  92. AMS949 (3 Posts)
  93. moegal (3 Posts)
  94. aleczapka (2 Posts)
  95. Stripeman (6 Posts)
  96. abhaysingh (5 Posts)
  97. mango (1 Post)
  98. NoahK17 (3 Posts)
  99. Remy (1 Post)
  100. medley (11 Posts)
  101. stevchen (1 Post)
  102. abraxxa (28 Posts)
  103. Efex (3 Posts)
  104. Rotomaul (2 Posts)
  105. miihiir (4 Posts)
  106. nebbian (1 Post)
  107. Riri (6 Posts)
  108. catalina (1 Post)
  109. Bing Qiao (1 Post)
  110. juferoto (2 Posts)
  111. bk1 (2 Posts)
  112. sami_user (1 Post)
  113. dmcclean (2 Posts)
  114. Pink.ME (3 Posts)
  115. sebrand (1 Post)
  116. charak (2 Posts)
  117. charleshimmer (16 Posts)
  118. patrosmania (4 Posts)
  119. rosecorp (1 Post)
  120. johrisd (1 Post)
  121. aomadevelopers (1 Post)
  122. nicola_java (1 Post)
  123. BitPoet (1 Post)
  124. OliverT (3 Posts)
  125. randomuser01 (2 Posts)
  126. schone (3 Posts)
  127. perdar (1 Post)
  128. ajain (3 Posts)
  129. getindas (1 Post)
  130. giega (1 Post)
  131. ryanyoungsma (1 Post)
  132. ph0enix (1 Post)
  133. italianboy (1 Post)
  134. LutzAlbers (3 Posts)
  135. Ajish (2 Posts)
  136. christophe67 (1 Post)
  137. jmariani (4 Posts)
  138. wki01 (4 Posts)
  139. wemerson.januario (1 Post)
  140. viciuascuns (4 Posts)
  141. JohnnyWheels (1 Post)
  142. nar (3 Posts)
  143. shab (2 Posts)
  144. mystik (1 Post)
  145. unnamed_dev (1 Post)
  146. ScottLoney (3 Posts)
  147. whodat (4 Posts)
  148. Alex84 (7 Posts)
  149. mjmonserrat (3 Posts)
  150. andy_ghg (2 Posts)
  151. knappy (1 Post)
  152. bareflix (2 Posts)
  153. makiavelli (1 Post)
  154. daniel_82 (1 Post)
  155. peteryjk (2 Posts)
  156. michael.pedrotti (1 Post)
  157. elona (3 Posts)
  158. chinnapandu (1 Post)
  159. jsundquist (6 Posts)
  160. feo (1 Post)
  161. dubito (2 Posts)
  162. Georgioa (1 Post)
  163. SchattenMann (4 Posts)
  164. Relleum (1 Post)
  165. ivan.kristianto (3 Posts)
  166. yeyepot (1 Post)
  167. raydeen (1 Post)
  168. easycodes (4 Posts)
  169. rockinrandall (5 Posts)
  170. redcs (3 Posts)
  171. hatsu1119 (1 Post)
  172. surendra_leo (1 Post)
  173. ssawchenko (11 Posts)
  174. Sigma (3 Posts)
  175. Lmouse (1 Post)
  176. Spongerusher (1 Post)
  177. ValiBOSS (1 Post)
  178. joe123 (3 Posts)
  179. scooter (3 Posts)
  180. harsha_velicheti (1 Post)
  181. ivanleblanc (9 Posts)
  182. m4v0 (3 Posts)
  183. jbusuulwa (1 Post)
  184. seedeg (6 Posts)
  185. Z24_2000 (3 Posts)
  186. markw (2 Posts)
  187. atutus (2 Posts)
  188. luke82 (3 Posts)
  189. rameshkt (2 Posts)
  190. elgalle (2 Posts)
  191. Vepe (2 Posts)
  192. barser (2 Posts)
  193. metra (5 Posts)
  194. hotdesc (4 Posts)
  195. chrislovecnm (1 Post)
  196. King_Aero (1 Post)
  197. idefix (5 Posts)
  198. daiei27 (3 Posts)
  199. LostSoul (2 Posts)
  200. tumbochka (3 Posts)
  201. Dipish (7 Posts)
  202. mcafee (1 Post)
  203. alexpotemkin (1 Post)
  204. ruperty (5 Posts)
  205. Rbn_3d (2 Posts)
  206. rxopt (1 Post)
  207. mayurid (1 Post)
  208. jeroen_syntux (2 Posts)
  209. aminaq (4 Posts)
  210. sosy (3 Posts)
  211. asafm (2 Posts)
  212. extjs1111_user (4 Posts)
  213. scottmartin (2 Posts)
  214. clements (1 Post)
  215. wavedan (3 Posts)
  216. jizhang88 (2 Posts)
  217. Coil (2 Posts)
  218. Samuel.reed (6 Posts)
  219. sense.nda12 (1 Post)
  220. zoja (1 Post)
  221. andyproxis (1 Post)
  222. baldeep_bhatia (1 Post)
  223. stevwinata (1 Post)
  224. Patrick86 (1 Post)
  225. dumpf (3 Posts)
  226. parimala (3 Posts)
  227. vicvolk (4 Posts)
  228. preichow (1 Post)
  229. shaoming (1 Post)
  230. Ixtinkt (7 Posts)
  231. jadiagaurang (1 Post)
  232. Juanyong (1 Post)
  233. venkateshns (1 Post)
  234. panpur (3 Posts)
  235. codeart.ch (2 Posts)
  236. hieu79vn (1 Post)
  237. mvsrekha (2 Posts)
  238. aislan (1 Post)
  239. buhari (1 Post)
  240. extjsquicklearner (1 Post)
  241. shankar8rajah1 (1 Post)
  242. jacinth_1215 (2 Posts)
  243. venkikodakirthi (1 Post)
  244. bwgv (1 Post)
  245. nckenn (1 Post)

Tags for this Thread