w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
JQuery UI Sortable: how to make items have droppable behavior (ex. hoverClass)?
For the hoverClass you can do something simiar with the over and out methods. The start and stop could also help you. $('.sortable').sortable({ over : function(){ $(this).addClass('valid'); }, out : function(){ $(this).removeClass('valid'); } });

Categories : Jquery

Jquery animate and offset causing unexpected behavior
The reason the 'menu-trigger' button stops working when you scroll down the content is because of this line: if (top.offset().top == 0) { The #top div is set to 'position: fixed;' which means that when you scroll down the content the 'top' value of this div changes from 0 because it is no longer at the top of the document. This causes your if statement to no longer work as you intended. Here is the working jsfiddle: http://jsfiddle.net/kVk82/3/

Categories : Jquery

jquery validation ajax and remote field unexpected behavior
You don't need the onsubmit: true option because that's the default behavior. Important: as per docs, onsubmitValidate the form on submit. Set to false to use only other events for validation. Set to a Function to decide for yourself when to run validation. A boolean true is not a valid value. In other words, you must remove that line because true will break the plugin. Quote OP: "When I enter a UserName that already exists I get the 'User Name already exists' message and the submitHandler is not called, as expected. But if any other validation check fails, the form gets posted normally to the form action url, and the submitHandler callback never seems to get called." The form is not supposed to post if there are outstanding errors, and the submitHandler is not

Categories : Jquery

Jquery UI sortable issue: image invisible after drop on the dynamically created sortable (both uls have same parent div)
My guesses are that the ul is 'hiding' the element.. as you drag it around you can still see the image until the border of the ul.. I think you need to use divs or spans and make use of the draggable of jQuery ui..

Categories : Jquery

jQuery UI Sortable: Trying to setup sortable but it seems the empty container does not take
Your sortable columns have to be aware of each other. Here is a demo of how to do it: fiddle An example from jQuery api docs Code: $( '.wrapper .row' ).each( function() { var column = $( '.column', this ); column.sortable( { items: '.item', connectWith:".column" } ); } );

Categories : Jquery

AngularJS - Directives, ng-repeat, ng-click and Jquery
I notice a couple of things: 1) you don't need the linking function at all. When you use a template, angular takes care of compiling the directives inside the template. Additionally, your linking function was binding to the selector element, not each li individually, hence why you couldn't determine the data object for which one was clicked. 2) Your directives are using the inherited scope, but both assigning different things to the same property name. In the selector directive, you are assigning $scope.selected to be a function. In the selected directive, you are assigning $scope.selected to be an array of values. These interfere because they are using the same scope. I was able to fix it by changing the first one to just $scope.select = function(data).... 3) Your wrote your even

Categories : Javascript

jquery sortable: How to sync 2 sortable lists?
This is a really bad hack, but it may give you a few ideas to start out on: Working Example $(function () { $('#sortable').sortable({ update: function (event, ui) { var x1 = $('#X1').position().top +140, x2 = $('#X2').position().top +140, x3 = $('#X3').position().top +140; $('#sortable2 li').css({ position:'absolute', width: $('#sortable li').width() }); $('#Y1').animate({ 'top': x1 }); $('#Y2').animate({ 'top': x2 }); $('#Y3').animate({ 'top': x3 }); } }); $("#sortable").disableSelection(); }); I say this is a really

Categories : Jquery

Sortable images with jquery sortable in HTML
You need to assign the id to the tr and the class to the td DEMO jsFiddle $(function(){ $('#comparison').sortable(); })

Categories : Jquery

JQuery can't read the innerHTML of a table row created by AngularJS' ng-repeat (IE8)
So you want to do some effect or animation on the row. You would do this with a directive, not standard jQuery. When doing things the Angular way, dom manipulation is ONLY done in directives. http://jsfiddle.net/engZB/ app.directive("animateHover", function() { return { restrict: 'A', link: function(scope, element, attrs) { $(element).on("mouseenter", function() { $(this).find("td").css("background-color","blue"); //Anything you want to do with the elements here }); $(element).on("mouseleave", function() { $(this).find("td").css("background-color",""); //Anything you want to do with the elements here }); } } }); <tr ng-repeat="friend in frien

Categories : Javascript

jQuery UI Sortable - Error: cannot call methods on sortable prior to initialization; attempted to call method 'disable'
Calling a .sortable() on any element makes the children of that elements sortable. That does not mean that the children are also initialized with the .sortable(). They are just a part of a sortable container which can be dragged around. And since you are calling .sortable('disable') on the child elements, it will give an error since the .sortable() was called on the parent and not the children. And the way you are disabling is also incorrect. Make use of the cancel property to exclude those elements from being sorted. Add this option wherever you are initializing your sortable. $("#avail_list").sortable({ cancel: ".disable-sort" }); And add that class to those elements that you want to disable. function disableDraggable(elements){ for (var i = 0; i < elements.length; i++)

Categories : Jquery

jquery sortable: The dropped sortable list item should have a class applied removing similar class in other items
Use .siblings() $( "#sections" ).sortable({ stop: function( event, ui ) { $(ui.item).addClass("selected").siblings().removeClass('selected'); } }); demo

Categories : Jquery

What is best way to get angularjs ng-repeat variable to a directive called withn the repeat
What you are trying to do should work just fine. Here is an example... http://jsfiddle.net/HB7LU/4269/ <div ng-repeat="val in values"> <my-directive val="{{val}}">{{val}}</my-directive> You can see that the value from the repeater is easily binded into the child directive. Since you didn't provide any code, its hard to see where you are going wrong, but it might have something to do with the fact that you are using a table in your html. There was a bug in Angular, which was fixed in 1.2.13, related to repeating over table elements, since browsers actually manipulate the DOM inside of tables on their own sometimes. Please see this bug report regarding that issue. I would update to the latest version of Angular and try again. If you still can't get it working, try t

Categories : Angularjs

AngularJS Outer ng-repeat not to register watches on inner ng-repeat
You could write a directive that takes both users and items as bindings attributes (especially because it seems like your inner loop is independant from the outer one), then manually nest two loops that would add content to the DOM, plus adding a scroll listener to each element. It's more hard-way coding but a lot less watchers.

Categories : Javascript

angularjs: ng-repeat-start and ng-repeat-end with inner ng-repeat
You should be able to use index-based iterations to bypass that: <tr ng-repeat-start="obj in rows" > <td ng-repeat="e in obj.row">{{obj.row[$index]}}</td> </tr> <tr ng-repeat-end> <!-- ... -->

Categories : Angularjs

Unexpected behavior in sub-query
You have a correlated subquery. This is a bit different from a non-correlated subquery, because it can include references to outer tables. When using correlated subqueries, always use the table aliases for all table references. This is a good idea in general, but should be followed more attentively for correlated subqueries. AND SGBSTDN_TERM_CODE_EFF = (SELECT MAX(SGBSTDN.SGBSTDN_TERM_CODE_EFF) FROM SATURN.SGBSTDN WHERE SGBSTDN.SGBSTDN_TERM_CODE_EFF <= '200002' AND SGBSTDN.SGBSTDN_PIDM = SFRSTCR.SFRSTCR_PIDM ) For each value of SFRSTCR.SFRSTCR_PIDM (and the other conditions), the subquery is getting the maximum date. In most versions of SQL, correlated subqueries a

Categories : SQL

unexpected behavior in types
During arithmetic operation the integer types are always treated as int primitive in Java if none of them is of type long. Small integer types are promoted to int and the result of the operation is int. Hence x*x is type casted as int and you are trying to assign it to short. You need an explicit cast to short for this narrowing conversion . short x_square=(short)(x*x); Follow the JLS 4.2.2 If an integer operator other than a shift operator has at least one operand of type long, then the operation is carried out using 64-bit precision, and the result of the numerical operator is of type long. If the other operand is not long, it is first widened (§5.1.5) to type long by numeric promotion (§5.6). Otherwise, the operation is carried out using 32-bit precision, and the result of

Categories : Java

Unexpected behavior of preg_replace with OSX
Strange. $ cat test.php <?php $str = ' à n'; file_put_contents('a.bin',preg_replace('/s+/', ' ', $str) . " "); file_put_contents('b.bin', 'à'); First, set up a test file containing à, named c.bin $ php test.php Then we cat files to compare : $ cat b.bin à$ cat c.bin à Files b.bin and c.bin contains à as expected $ hexdump -C b.bin 00000000 c3 a0 |..| 00000002 $ hexdump -C c.bin 00000000 c3 a0 0a |...| <00000003></00000003> Thanks to hexdump we can assume that à is c3 a0 $ cat a.bin ? n $ hexdump -C a.bin 00000000 20 c3 20 6e 0a | . n.| 00000005 In the first file, a.bin, there is no a0 (NO-BREAK SPACE) and the accent is ba

Categories : PHP

Unexpected localeCompare Behavior
You test can't never return 0, because you don't have any input with id input1, and the div with this id won't be this when the keyup event is raised. Supposing you give the id input1 and input2 to your inputs, your code is still too complex. You don't need localeCompare to test string equality. And I suspect you didn't get that the result pass as true in a if test when the strings are different. You seem to want $("#input1, #input2").keyup(function() { if ("input1"===this.id) { calculateA(); } else if ("input2"===this.id) { calculateD(); } });

Categories : Javascript

Unexpected ifstream behavior?
What causes such weird behaviour of the text input? return output.str().c_str(); returns a pointer which points to a local variable, when function loadSource returns output goes out of scope vs_source/fs_source are dangling pointers. Access to vs_source/fs_source have undefined behavior. To fix your issue, you could return std::string instead: std::string loadSource(const char* path) { //... return output.str(); } std::string vs_source = loadSource("vertex.vert"); // vs_source loads fine std::string fs_source = loadSource("fragment.frag");

Categories : C++

Sortable table columns with AngularJs
Updated jsfiddle: http://jsfiddle.net/gweur/ sza is right, you did forget the $scope.sort object, but you are also missing the orderBy filter in your ng-repeat |orderBy:sort.column:sort.descending Additionally, you'll need to explicitly pass the column name to the changeSorting() function, like ng-click="changeSorting('text')" not sure if there is a different way you can handle this. Finally, ng-click is the correct syntax for the version of AngularJS you are using.

Categories : Angularjs

AngularJS/UI ui-sortable does not have isolated scope?
I just copied and pasted the latest sortable.js code to the jsfiddle editor, and removed the link <script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui/0.4.0/angular-ui.min.js"></script>. It seems to work properly. Please take a look at the demo. Demo

Categories : Angularjs

BindingList INotifyPropertyChanged unexpected behavior
BindingList<T> doesn't check if each particular item implements INotifyPropertyChanged. Instead, it checks it once for the Generic Type Parameter. So if your BindingList<T> is declared as follows: private BindingList<ITest> _listTest1; Then ITest should be inherited fromINotifyPropertyChanged in order to get BindingList raise ItemChanged events.

Categories : C#

WPF Databound ComboBox unexpected behavior
It looks like it's doing exactly what you asked it to: first, SelectedValue="{Binding FileOption}" (and, this is a binding, so subsequently setting the selection will update the property in the viewmodel) then, SelectedIndex="{Binding FileTraceComboBoxDefault}" You probably want to set/bind just one of SelectedValue or SelectedIndex.

Categories : Dotnet

unexpected behavior of linux malloc
It's pitch black, you are likely to be eaten by an OOM killer. Linux has this thing called an OOM killer which wanders about killing off processes when it finds memory allocation is very heavy. The selection of which process(es) to kill is based on certain properties of each process (such as one allocating a lot of memory being a prime candidate). It does this, partly due to its optimistic memory allocation strategy (it will generally give you address space whether or not there's enough backing memory on devices for it, something known as overcommit). It's likely in this case that, when allocating 1M at a time, an allocation fails before the OOM killer finds you. With 4K, you're discovered before the allocation routines decide you've had enough. You can configure the OOM killer to

Categories : Linux

Unexpected behavior on 1..N relationship Mongoid
Worked it out for anyone who wanted to know added class Student has_and_belongs_to_many :courses, inverse_of: nil Also removed belongs_to :student from Course

Categories : Ruby On Rails

ember.js: unexpected behavior of controller
In your previous code you are returning @get("content").toArray().length This isn't needed since that content is a DS.RecordArray, and it behaves like an array and have a length property. So this works: @get("content.length") But I think that the main problem is the property("content"), you must specify the value that matters for the computed property, in that case, isn't the whole content, but your property length. So the correct is property("content.length"). The final result is: App.LacesController = Ember.ArrayController.extend contentCount: ( -> @get("content.length") ).property("content.length")

Categories : Ember Js

Unexpected behavior using Autolayout with NSSplitView
I had the same problem and got around it by using NSViewControllers within each split view pane so that I didn't directly have split views embedded in split views. It's more code and more complex but it does seem to work. I never found a solution for when split views are embedded in split views so I'll be interested if anyone has an answer.

Categories : Xcode

Unexpected behavior with ParSet's zipWithIndex
The order of elements is unexpected by definition of sets — implementation specific order. When you do zipWithIndex you actually reveal different order in different implementations. If you take other Set implementations, you will get the other order and accordingly the other set of pairs (orderPos, element). The other source of unexpected behavior is nonassociativeness of zipWithIndex: http://docs.scala-lang.org/overviews/parallel-collections/overview.html#nonassociative_operations I think that if you run x.par.toSet.zipWithIndex many times you can get different results from time to time (probably for longer collections). Updated I've run it a couple of times: scala> x.par.toSet.zipWithIndex res0: scala.collection.parallel.immutable.ParSet[(Int, Int)] = ParSet((4,0), (8,1), (

Categories : Scala

Batch file unexpected behavior
You need to use delayed expansion. Inside a FOR or a IF, the variables are "expanded" before and not during command execution. ( expanded = the variable is remplaced by its value ) In order to change the value of a variable and use it in the same loop, you should use the delayed expression. You must write SETLOCAL ENABLEDELAYEDEXPANSION at the beginning of your code and the variable whose expansion should be delayed should be surrounded by exclamation marks instead of percent signs. So echo %a% become echo !a! EDIT Moreover, your set a = %%n is invalid since you affect the value of n at the variable "a " and not "a". you must write set a=%%n ( without a blank space before the equals signe )

Categories : Batch File

Java App unexpected behavior when exported
When you create a jar from Eclipse, your assets don't get copied over to jar or location is not preserved. Open the jar and check if you have your templates in the right location or you have it at all. To have the exported jar include your assets/resources- Right click on your project in Eclipse. Then New -> Source Folder. Name the source folder anything. e.g. template_src. Copy or drag the entire directory of your template to template_src. Then make the jar.

Categories : Java

Checkbox tabindex unexpected behavior
Because of the ordering of your inputs, the tabindex of text2 actually corresponds to its zero-based ordinal position (2) within the elements collection, causing you to focus text2. You'll need to add 1 to next in order to select text3 within the elements collection.

Categories : Javascript

Unexpected format string behavior
It ( ) is a carridge return without a linefeed so the cursor moves back to the start of the current line without moving onto a new line and therefore overwriting what is already displayed. The behaviour depends on your console and whether it interprets CR and LF as individual operations.

Categories : Python

Python-unexpected behavior when I don't decode to utf-8
In Python 3, when you pass a byte value (raw bytes from the network without decoding) you get to see the representation of the byte value as a Python byte literal. This includes representing newlines as characters. By decoding, you now have a unicode string value instead, and print() can handle that directly: >>> print(b'Newline Another line') b'Newline Another line' >>> print(b'Newline Another line'.decode('utf8')) Newline Another line This is perfectly normal behaviour.

Categories : Python

Unexpected behavior with MPI_Ssend and MPI_Recv
You haven't said how you do the check which function is called first. Cout'ing something on screen doesn't guarantee proper order of displaying messages (at least while using MPI). You don't need to put MPI_Recv in loop since it is a blocking function. Its not even recommended while you didn't assign starting value to *rcvDone. Its not safe to use malloc together with some MPI functions. Read "thread and interrupt safety" section on http://www.mcs.anl.gov/research/projects/mpi/www/www3/MPI_Ssend.html

Categories : C++

Unexpected behavior using getters and setters
Crazy Train has already answered it in the comments. The question is listed having 0 answers so I'll add it as an answer. When adding a variable containing an object to an array you add a reference to the variable, when you re assign the variable the reference is broken. Adding a variable containing an object to an array then re assigning the variable doesn't change the object in the array: var arr=[]; var object={name:"John"}; arr.push(object); object=33; console.log(arr);//=[Object {name="john"}] Adding a variable containing an object to an array then changing the internal values of the object that the variable contains does change the object in the array: var arr=[]; var object={name:"John"}; arr.push(object); object.name="Jane"; console.log(arr);//=[Object {name="Jane"}] So to

Categories : Javascript

Angularjs - tinyMCE 4 directive not working after using sortable
Daniel, It's a known issue, I have managed to work it out with ng-include, so that the tinymce textarea will be in it. like this: <ul ui-sortable="sortableOptions" ng-model="appData.data"> <li ng-repeat="box in appData.data" boxlistitem ng-include src="box.template_name"> </li> </ul> <script type="text/ng-template" id="tinymce_module"> <textarea ng-model="box.title" value="{{box.title}}" class="tinyMCE" ui-tinymce="tinymceOptions"></textarea> </script> and in the controller you need to do something like this: $scope.sortableOptions = update: (e, ui) -> box.template_name = "" $timeout -> box.template_name = "tinymce_module" ,0 just find your way to pass the {{box}} to the update function in sortableOpti

Categories : Javascript

Unexpected behavior using unset() on an array that has been shuffled
Just saw this which provided the answer: PHP shuffle not working like expected on my nested array So just added unset($r) after the foreach() loops and it works fine.

Categories : PHP

Unexpected behavior creating instance of type
The trick to solving this was to add Generics to the ICommand Interface, and make use of the extra information in the CommandInvoker. Interfaces/Classes now look like this: Public Interface ICommand(Of T) End Interface Public Interface ICommandHandler(Of T as ICommand(Of T)) Sub Handle(cmd as T) End Interface Public Interface ICommandInvoker Sub Invoke(Of T As ICommand(Of T))(ByVal command As ICommand(Of T)) End Interface Public Class CommandInvoker Implements ICommandInvoker Public Sub Invoke(Of T As ICommand(Of T))(command As ICommand(Of T)) Implements ICommandInvoker.Invoke Dim handlers As Generic.IList(Of ICommandHandler(Of T)) = Nothing handlers = ioc.GetAllInstances(Of ICommandHandler(Of T))() For Each h As ICommandHandler(Of T) In

Categories : Dotnet

Unexpected command line behavior using commata
Comma is a standard delimiter in batch as well as ; <space> = <tab> and evertything after the comma is taken as an other parameter to echo and only one parameter is taken for the redirection.You can try to ecnlose a,b in quotes and this should change the behaviour of the outputand produce a,b file.you can also escape the delimiters with ^ - echo a>a^,b You can try also echo a>a=b - it will be the same

Categories : Batch File

Sequential file initialization unexpected behavior
It would be the best to overload the operator << friend ostream& operator<<(ostream& out, const Hardware& h) // output { out << "(" << h.id() << ", " << h.whatever() << ")"; return out; } and read the file line by line to the Hardware object. By the way, overloading the input operator >> is also possible.

Categories : C++



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.