JQGrid, Search related issue - search

Is there anyway to validate the search field (I'm using custom search) before sending request to server? Validation is working fine with row editing and adding mode. Let say I want to search column price and error message should occur when user enters a text in search field.
If search returns no data, I want to post a message on the screen. I see no events in search function that can get the server response. The onClose event happened when the search box is closed, but I don't know how to get the server response from this?
Another question, I've tried to use gridResize but it's not working, everything else is working just fine, I see no resize icon in bottom right corner. Please take a look at my code below:
jQuery("#list").jqGrid('gridResize',{minWidth:350,maxWidth:800,minHeight:80,
maxHeight:350});

The part of your question about the validation of the custom searching seems be the same which I answerd here. The answer include the demo where the validation of the 'Client' field is included.
How you can see, the custom searching is moved in the grid.addons.js module in the 4.0.0 version of jqGrid, so it can be removed in some later versions of jqGrid.
There are no special searching request to the server. There are exist just the standard request to fill the grid, where the _search parameter (corresponds to search parameter of jqGrid) are set to true and some other parameters like filters describe the filter criteria. So you can use emptyrecords parameter of jqGrid (see here). You can follow the demo (see the answer) which shows the message in the grid body.
You problems with gridResize seams me very easy. i suppose, that you either not included jQuery UI JavaScript (including of CSS only is not enough) or you placed call of gridResize in the wrong place. You don't posted the JavaScript code and the HTML code which could shows which JavaScripts files you have loaded and in which order. So I can not answer more exactly.

Related

Alfresco community 4.2.c pagination

In our old project we're using Alfresco 4.2.c community version.
There's a task page there, were you can use predefined filters to manage data you want to see.
I was able to add some extra filters there, anyway another problem stands in my way.
There's a paginator there, probably from YUI, which works by two parameters, maxCount and skipCount.
Right now it's configured to show max 400 records on one page.
I'm trying to add an option to display all records at once. Is anyone familiar enough with that system to even tell if it's possible? YUI framework is very hard to manage.
It seems like on every page or filter change it redirects you to ahref='#', a then a method reads the filter id and gives some extra parameters to the request. I can't find a way to maybe bind another button to reload the page in the same manner and just add another line to the request, which would make the paginator show all the records at one page.

CouchDB/Sofa: Cannot create new post (from default template) with save button

I am currently learning CouchDB and using the O'Reilly book as a guide to get started. I've been following it pretty thoroughly, however, upon working with Sofa, the book requires me to inspect what happens when we hit 'Save' on our edit template. The book says that I should see a success response (uses Firebug the button triggers the Put request), however, instead I get a "
{"error":"not_found","reason":"missing shows function new.html on design doc _design/sofa"}"
Now I only started reading this week and I know the answer might be obvious, but if someone could at least point me in the right direction (where in Sofa to add, fix a bug, patch) that would be great.
My initial guess is that I need to add a "new" shows function, but I just wanted some advice before I delve into this wild goose chase.
sorry if this is a noob question.
{"couchdb":"Welcome","uuid":"4d9b6082e16607a33dcbfdffb57503b5","version":"1.6.1","vendor":{"version":"1.6.1","name":"The Apache Software Foundation"}}
Downloaded the newest version of Sofa from (https://github.com/jchris/sofa)
How to resolve the issue
The issue is that the page is being accessed from:
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit
Access it instead from:
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit/
(Your database name may differ from 'myblogdb'). Note the trailing backslash.
Explanation of why a show function called "new" is not necessary:
Take the following query to a show function:
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit/This-is-a-second-post
This will call the function in edit.js and pass in the document with an _id of This-is-a-second-post, if such a document exists. If the document doesn't exists, as in the case of
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit/new.html
Then edit.js sets up the data object passed to Mustache.to_html to have the correct fields for a new post.
Why it breaks in your case
When the edit show function is accessed via
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit
The relatives paths to the scripts no longer work.
Then the script defined in edit.html is no longer correct.
As a result, the submit handler
$("form#new-post").submit(function() { ...
is no longer called. If it were called it would return false at the end, which prevents new.html from being POSTed.
Since it is not called, new.html ends up being POSTed, and that redirects the browser to
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/new.html
which points to a non-existent show function, resulting in the error message you are seeing.

Google Docs Zoom Querystring Parameter

Is there a way to set the zoom level in google docs by using a querystring parameter?
eg- https://docs.google.com/a/getsatisfaction.com/document/d/q3ljkasdlfgkjsdflgkj/edit?zoom=fit
I know there's other querystring parameters you can set, like how "render mode" can be set with the rm parameter (eg - rm=demo). I also found this related SO question, which doesn't mention zoom options.
I have been searching for a while now and have not found any concrete way to manipulate the user's view setting of a document when it's embedded into a webpage via iframe. The only options I have found for getting a doc to adjust within the given frame are as follows:
/pub? - This removes any toolbar display and displays a rough view of the doc. If you use tabs or spaces to line things up, they will not look pretty with this option. I have tried adding the "rm=full" and/or "ui=2" parameters (and other combinations) but those did not do anything.
/preview? - This also removes any ui elements and just straight-up shows the doc. This one doesn't work for me because I need users to be able to print the doc.
I even thought that perhaps the view setting was determined in the doc itself, but anything I tried in that direction (setting to Fit, looking in doc settings, etc) produced no results. So the parameters I am using now are:
/edit?usp=viewing&chrome=false&rm=demo (still overflows in the iframe in Firefox & Chrome)
I hope this info helps anyone else at least a little bit. (I would have provided all this as a comment but I needed more points in order to do that.) It's disappointing that one of the most obvious and relied-upon Docs options cannot be adjusted through parameters.

How to write text values in masked field?

i need some help related to masked field in web form. Syntax of phone field is (___)___-_____, if i execute this code in ruby shell
browser.text_field(:id => 'txtphone').set '7893457889'
... nothing has been added in the phone field.
then i find this solution in one blog, someone said first unmask this field using this code.
browser.text_field(:id,'txtphone').fire_event("unmask")
then write the above code again.
browser.text_field(:id => 'txtphone').set '7893457889'
but still nothing has happened. kindly help me out...am i doing right or still there is a mistake.
If you could provide some sample of the page HTML it will be easier to give you an answer more likely to work.
Given what you have provided us to work from, we have to go with the normal way that such masked input fields typically work and go from there. Usually pages with this kind of thing are calling a javascript function which is triggered by a specific event. Most often this is an event such as onchange but it may be something like keypress or any other even that happens when a normal user types or pasts text into the cell.
You likely need to experiment with using the '.fire_event' method to fire the proper javascript event, or if that fails entirely making a direct call to execute the proper script
When doing this do not confuse the name of a script such as 'applymask' or somesuch with the javascript event which causes that script to be invoked.
The answers to this question How to find out which JavaScript events fired? include some good information on how to use firebug or the chrome developer tools to figure out what events are being fired when you interact with an object on the browser screen.
Update: instead of responding here to indicate if this answer was of any use the OP reposted their question here Masked Text Box issue and by digging around on the vendor's demo site (since that time he actually had posted some of the HTML when we asked for it) I was able to find a solution using watir-webdriver that worked for him.

Drupal: Cannot save any nodes of certain content types, used to work

Whenever I save or create a node of a certain user-defined type, I am back in the edit window instead of switching to the first tab labeled view. All my fields (body, title etc. are as they were and no message appears, neither directly on the page nor in the watchdog database log. The validation is working, though, because I see those 'required' messages as soon as I try to save without Title for example.
The strange thing is that when I create a new content type, or use the predefined story and page types, I can edit and create nodes. In the latter case, Drupal answers with an 302 redirect, whereas with the proplematic content types, only a 200 HTTP status is returned.
The issue doesn't seem to be related to either JavaScript (on or off, no difference), Browser (tried Chrome and Firefox) or WYSIWYG (used input formats with and without).
I'm using Drupal 6.22 and the CCK. I have about 7 content types, some of them with fields. I am not using Rules, but a multitude of modules, all of which are up-to-date. I will post a list if this issue can't be solved otherwise.
I have spend the last hours trying to figure this out, both by looking at my installation (settings, database) and by searching Google & Co.
Any ideas?
The situation appeared because Drupal translated both the Upload and the Save button to one word, Speichern. The FileField issue tracker contains the corresponding thread: http://drupal.org/node/684426
The ImageField and Locale modules, along with a language such as German or Finnish were partly responsible for the trouble.

Resources