There is a way to do search in client side after the server to response json data?
The jqGrid search example with only html/jscript and array of type local perform the search of the datas on client side, but when a have the same jqgrid deployed within the server, with json return the jqgrid hint/request for the server.
I would like to know about this behave on more deeply!
best regardless!
If I understand correctly your requirements you need just add loadonce: true to the kist of jqGrid parameters. It will follows to changing datatype from 'json' or 'xml' to 'local' after the first filling of the grid with the server data. So you can call filterToolbar to use toolbar searching of use navGrid to add button used in advanced searching. Any kind of searching will be implemented locally.
Related
I am using extension library Rest controls ViewJsonservice to provide the data from Notes database, is there a easy way using same control I can provide the data from two databases, I can put the similar view from dbA to dbB
Short answer: no
Long answer:
I presume you want the data from 2 views available in a single endpoint. Either after each other (appended) or somehow merged.
You can do that using code. Check this article for basic info.
In a nutshell: use the ViewNavigator class in both databases to retrieve results and append or merge the data before you return it.
Nice side effect : you can return all the data.
I wonder if there is a way to write some show, list or update functions in a design document as I can do for a view one in Fauxton (with its editor).
When I create a view in Fauxton, I simply click the "Add view..." button. Then, I fill the fields for the design document and view names, and I can write my JS Code directly in the editor. When I save, the design document is correctly generated with my view function correctly escaped.
When I want to write a list for example, I have to edit the design document and write my function, for example:
...
"lists": {
"my-list": "function(head,req) {\n send(\"Simple Test\");\n}"
},
...
But it's tricky to correctly insert \n or \" as the function has to be passed as a string. It's very easy to forget something writing a function in this way.
I can't find a "add list..." option somewhere in the interface, so I use to create a new view with the application editor, change the function signature, save the document and then edit it again to cut/paste the function in its correct place, but it's not a solution.
So, what could be a better way to write theses functions ? (even with an external editor and then upload the function ?) Is there a way to write the JS Code in a external editor (Atom for example) and then "generate" the correct espaced string value for this function to upload into couchdb via curl?
Consider using Photon https://github.com/ermouth/couch-photon, it has decent editor for JS functions in JSON docs.
i have text box in my website. this text box give text value with form and post method.
this form search special text in database.
How can I be certain of the safety input data from sql injectin or xss.
Because of the nature of the ORM database style in Symfony2 you are naturally protected from SQL injection. Data that does not match the constraints set by your configuration or Validator class will be rejected before reaching the database anyways.
Data is automatically encoded before being passed into the Request Class. XSS is not possible because on both the receiving side and the outputting side the data is not in its RAW form unless you specify it to be, in which case you would negate the built in security anyways.
XSS in forms is not feasible because Symfony by default (when using the Form Class) will create CSRF tokens in your form submissions to validate the sender of the request. Unless you specifically disable them, they will generate automagically and be included in a hidden field.
The built in functionality of symfony is only a first step, the best practice is to use Data Transformers to ensure your data is of the format and type you expect it to be.
Data Transformers: http://symfony.com/doc/current/cookbook/form/data_transformers.html
Finally, on the note of SQL Injection, using the built-in Query builder or using the DQL language (if your using doctrine) is another layer of security to prevent injections when using highly customized queries.
We need to provide search options for users to find content based on specific field values.
We're developing a Training Course module for a client but the standard search looks for the text in any indexed field. We want to allow users to find courses based on searches against specific fields (i.e. Course Type, Location, Price, Date).
We've extended the search to check against specific fields but can't work out how to get the URL parameters passed by the Search form as a GET.
Where does Orchard put URL parameters?
Also, are we missing something, is there a way that Orchard already supports this that we haven't realized?
I would suggest you to copy part of the Search module, more specifically the Controller and the View and then modify it to suit your specific needs. I see you are actually modifying the original module, but this might be a problem on the long term, for instance if we start updating the module you might either lose you changes or have to reapply them to the code base. In the end you will target a MySiteName.Search module. And you can also add custom routes, custom settings.
On a side note the Search API is really powerful and you can even use it to do faceted search, or search on inherited taxonomy terms, tags, full text, ranges, ... Having your own controller code will let you use all of these features easily.
I need validate multiple fields in the JavaScript Framework, but can't figure out how.
What kind of validation do you need?
Client side: you must use a Javascript validation framework. For example, this one is a good validation framework using jQuery.
Server side: you just need to use <f:validateXXX/> components. For exmaple, <f:validateLength minimum="2" maximum="8"/> will check that the field contains a value that has a size between 2 and 8 characters. Otherwise, it will throw an Exception. Note that there a few validator by default, and you will not be able to validate an email address, or something like that. However, it is really easy to develop your own validator...
Server side, using Ajax. This is almost the same thing as the previous type of validation, except that the validation is ajaxified, which means that a request will be sent to the server once the user fills a field, and then validate the field. This is usefull to check on the fly the value. The component library Richfaces offers such features.
JSF has validation framework that can be used for simple validations. Like mandatory, length, format etc.
In addition it allows you to write custom validators which are invoked for field validations once configured in myfaces file.
Also a bunch of fields can be grouped into "SubForms" which will let you validate several fields in a go. A seamless validation without page being submitted would require Ajax integration. (Richfaces is a good option)