Posts

jquery - How can I test if a JQM form element is Enhanced? -

I am trying to check the program if a form element is 'extended' to the default markup. I realize that I can cross the dom and search for a field contents or other JQM specific attributes or tags, but is this a better way? Since each form element is different in markup, I was expecting a way $ ('# myformelementid'). Advanced> Are you asking for a way to use the property through a custom function? I think you should be able to use it: // before your widget logic $ .fn.extend (advanced: function () {this.jqmData ('advanced ')}}});

javascript - .val assign to variable on submit of form -

How can I perform this variable counting function when a user hits the submit button? Var size = $ ("# size"). Val (); & Lt; Input id = "size" /> & Lt; Button type = "submit" & gt; Calculation! & Lt; / Button & gt; They should be assumed to be input and store it in variable = size Is it possible that the user reloaded without reloading this page Output it back without JQuery? P> Attach an event handler to submit form event Original example HTML prevent event handler from sending form to preventDefault () Should call for. / P> & lt; Forms & gt; & Lt; Input id = "size" /> & Lt; Button type = "submit" & gt; Calculation! & Lt; / Button & gt; & Lt; / Form & gt; & Lt; Div id = "output" & gt; & Lt; / Div & gt; JavaScript var size; $ ("Form") Submit (function (e) {e.preventDefault (); // size = $ (...

ruby - Single-table inheritance using a datetime column -

I have a user class that handles both registered and unregistered users in our database. I have maintained the user and registered users of subclasses I'm leaning towards using STI, but I think it's adding some repetition to my code where it's not really necessary. I am currently planning for the ad "Type" and "Registered" column. In fact everyone needs to be present whether or not they are presently included on the "registered_at" users. User t.string "type" t.datetime "register_at" This rail does not fit the STI conference, but it seems like something Reduce the repetition which is otherwise unnecessary. Does this make sense and how do I create it in my user model? Why not only use scope? Scope: unregistered, lambda {where (: registered_it => zero)} scope: registered, lambda {where ("registered_t is not empty")} and like them: User.registered.first Edit Get your Subclasses from U...

regex - Find string match in R -

I have data with two columns and thousands of rows. Frame is like: column 1 column 2 "This is done in 1 hour" "in 1 hour" I get a new data is. The frame column is as follows: Column 3 "This is done" so basically corresponds to the string according to column 2 and the remaining Get Column 1 How is this approach? Edit: This problem will not be solved because the length of the wire is different, so I can not do this: Substright (x , 3) then I need something like grepl mailing You can do it with regular expressions: & Lt; - Data. Frame (Column 1 = "This is done in 1 hour", column2 = "in 1 hour") Data $ column 3 & lt; - gsub (Data $ column2, '', data $ column1) # Change the fist parameter to the second position in the third. EDIT: For more than 1 line, you can type : data & lt; - Use data.frame (column 1). = C ("This is done in 1 hour", "This is an exam"), col...

Cakephp how should you manage controllers and views -

I'm totally new to KHHP, so I'm completely confused that the various controls / views / elements How Management Works / P> PROBLEM: I am trying to create my home page, which has a page controller and see home.ctp. Now, I have another controller, Idea controller, which includes functions to load all the ideas from DB. Public function index () {$ this-> Set ('title_for_layout', 'ideas'); $ This- & gt; Set ('idea', $ this-> idea-> search ('all')); } Now, I need to access this Idea Controller with multiple (up to 3) different views. What is the best way to do this? Thanks - You are going to the other side ... The view controller does not have "access", the controller receives a request, tells the model what information they need, and passes all necessary data views. Thoughts are like small dolls that can put clothes on you, but nothing more than that, they do not play or play or ask random questions to yo...

jquery - vex confirm dialog, cancel-action as default -

I'm trying to use a modal script for a confirmation dialog, for now, if the confirmation dialog box appears , Then "OK" - the button is selected as the default. Does anyone know how can I change it? I want the cancel button to be the default so that anyone gets hit, just nothing happens. Thank you for your reply. Best regards to Thomas Set the text of the buttons in your array vex.dialog.open ({message: 'Do you want to completely destroy the alien planet?', OverlayCloseOption: wrong, click incorrectly to // click outside the callback Do: function (value) {console.log (value);}, button: [$ .extend ({}, Vex.dialog.buttons.YES, {text: 'your button for yesy}}), $ .extend ({}, Vex.dialog.buttons.NO, {text: 'for not your button'})]});

c# - Using "row.Selected = true" changes appearence but not CurrentRow index -

I have a snippet of code that searches for grids and records for the desired record: foreach (grddActiveJobs.Rows in DataGridViewRow) {if (line.kel ["part number"]. Value.ToString () == lvPartNum & row.Cells ["serial number"]. Value .toString () == lvSerialNum) row.Selected = true; } works as the above code - The row is highlighted, however, if I run an investigation on currentrow.index If (grdActiveJobs.ContentRow.Index == 0) {// dots} This will show the current index as 0, even if the highlight of the highlighted by the previous snippet is indicative of row 5 . My question is, when "row.selected = true" is set, how can I ensure that the existing line index for the grid is set correctly and not known as 0 is? Thank you in advance. After some excavation I found this explanation: GridName. CurrentRow.Index - Returns the indicator of the current cell defined by the system, which is not always the same as the selected cell. An...